From 4e992cd901f8ab7241edf74910804aea3fa5e32c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Tue, 16 Jul 2019 16:26:31 +0200 Subject: [PATCH] GCC ARM: Increase develop and release debug level 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} --- tools/profiles/develop.json | 2 +- tools/profiles/release.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/profiles/develop.json b/tools/profiles/develop.json index ff19cd6c3b..d7657ec2f0 100644 --- a/tools/profiles/develop.json +++ b/tools/profiles/develop.json @@ -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"], diff --git a/tools/profiles/release.json b/tools/profiles/release.json index 4007eaf581..f989a96717 100644 --- a/tools/profiles/release.json +++ b/tools/profiles/release.json @@ -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"],