Skip to content

Commit

Permalink
GCC ARM: Increase debug and develop debug level
Browse files Browse the repository at this point in the history
Do not specify the debug level for develop and release profiles. Instead
rely on the compiler to choose sensible default (-g2). Note that -g1 is
minimal debugging information and does not include structure definitions
which quite heavily reduces debugging experience.

For develop and release profiles this results in elf file containing
structure definitions. This does not impact debug profile as it already
did use -g3 which is the highest debug level.

Compatible debuggers (eg. gdb, SEGGER Ozone) can use the extra information
to provide better debugging experience. For example, when compiled .elf is
loaded in gdb, this change makes it trivial to access internal RTX data.

Without this change on develop profile:
  (gdb) print osRtxInfo.thread.run
  'osRtxInfo' has unknown type; cast it to its declared type

With this change on develop profile:
  (gdb) print osRtxInfo.thread.run
  $1 = {curr = 0x20014F04, next = 0x20014F04}
  • Loading branch information
desowin committed Jul 18, 2019
1 parent 9cdfe37 commit 68e9b3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/profiles/develop.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"-fmessage-length=0", "-fno-exceptions",
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
"-MMD", "-fno-delete-null-pointer-checks",
"-fomit-frame-pointer", "-Os", "-g1", "-DMBED_TRAP_ERRORS_ENABLED=1"],
"-fomit-frame-pointer", "-Os", "-g", "-DMBED_TRAP_ERRORS_ENABLED=1"],
"asm": ["-x", "assembler-with-cpp"],
"c": ["-std=gnu11"],
"cxx": ["-std=gnu++14", "-fno-rtti", "-Wvla"],
Expand Down
2 changes: 1 addition & 1 deletion tools/profiles/release.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"-fmessage-length=0", "-fno-exceptions",
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
"-MMD", "-fno-delete-null-pointer-checks",
"-fomit-frame-pointer", "-Os", "-DNDEBUG", "-g1"],
"-fomit-frame-pointer", "-Os", "-DNDEBUG", "-g"],
"asm": ["-x", "assembler-with-cpp"],
"c": ["-std=gnu11"],
"cxx": ["-std=gnu++14", "-fno-rtti", "-Wvla"],
Expand Down

0 comments on commit 68e9b3e

Please sign in to comment.