Hi,

On the latest develop with the latest macOS Sierra and homebrew, If I have a target:

targets/slim_slinky
    app=apps/slinky
    bsp=hw/bsp/native
    build_profile=debug

(used to be optimized :-)

And I try and build:

$ newt run slim_slinky
Error: In file included from /usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/syslimits.h:7:0, from /usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/limits.h:34,
                 from encoding/tinycbor/include/tinycbor/cbor.h:29,
                 from mgmt/newtmgr/include/newtmgr/newtmgr.h:23,
                 from apps/slinky/src/main.c:37:
/usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/limits.h:168:61: error: no include path in which to search for limits.h

I get beyond this by compiling out gcc-5, and instead using the native Mac LLVM compiler (fixes in dev to make the system work with that). However, the next issue is gdb:

$ newt run slim_slinky
<snip>
[/Users/sterling/dev/mynewt/core/hw/bsp/native/native_debug.sh /Users/sterling/dev/mynewt/core/hw/bsp/native /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky] Debugging /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf
<snip>
Reading symbols from /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf...done.
(gdb) c
The program is not being run.
(gdb) r
Starting program: /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf
During startup program terminated with signal ?, Unknown signal.
(gdb)

If I switch to using llvm debugger, I can debug the system. Which is fine, but I do generally prefer gdb due to familiarity. Still, for those searching for a quick solution, lldb is fine.

Has anyone had success making these work on the latest macOS sierra. My toolchain information:

$ gdb --version
GNU gdb (GDB) 7.12
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin15.6.0".
$ gcc-5 --version
gcc-5 (Homebrew gcc5 5.4.0) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Attached is a patch that made things work with llvm.

Sterling
diff --git a/compiler/sim/compiler.yml b/compiler/sim/compiler.yml
index 1fddf4b..057b523 100644
--- a/compiler/sim/compiler.yml
+++ b/compiler/sim/compiler.yml
@@ -41,8 +41,8 @@ compiler.flags.base.LINUX: >
 compiler.ld.flags.LINUX: -lutil
 
 # OS X.
-compiler.path.cc.DARWIN.OVERWRITE: "/usr/local/bin/gcc-5"
-compiler.path.as.DARWIN.OVERWRITE: "/usr/local/bin/gcc-5"
+#compiler.path.cc.DARWIN.OVERWRITE: "/usr/local/bin/gcc-5"
+#compiler.path.as.DARWIN.OVERWRITE: "/usr/local/bin/gcc-5"
 compiler.path.objdump.DARWIN.OVERWRITE: "gobjdump"
 compiler.path.objcopy.DARWIN.OVERWRITE: "gobjcopy"
 compiler.flags.base.DARWIN: >
diff --git a/hw/bsp/native/native_debug.sh b/hw/bsp/native/native_debug.sh
index f412408..cd69811 100755
--- a/hw/bsp/native/native_debug.sh
+++ b/hw/bsp/native/native_debug.sh
@@ -40,4 +40,5 @@ FILE_NAME=$BIN_BASENAME.elf
 
 echo "Debugging" $FILE_NAME
 
-gdb -x $GDB_SCRIPT_PATH $FILE_NAME
+#gdb -x $GDB_SCRIPT_PATH $FILE_NAME
+lldb $FILE_NAME

Reply via email to