From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 904F93858405; Thu, 23 Dec 2021 02:48:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 904F93858405 From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug macros/27754] Excessive CPU load and memory usage with -g3 debug info Date: Thu, 23 Dec 2021 02:48:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: macros X-Bugzilla-Version: 10.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simark at simark dot ca X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Dec 2021 02:48:10 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27754 --- Comment #20 from Simon Marchi --- (In reply to rdiezmail-binutils from comment #18) > I just did another test after upgrading the toolchain to these versions: >=20 > BINUTILS_VERSION :=3D 2.37 > GMP_VERSION :=3D 6.2.1 > MPFR_VERSION :=3D 4.1.0 > MPC_VERSION :=3D 1.2.1 > GCC_VERSION :=3D 10.3.0 > NEWLIB_VERSION :=3D 4.1.0 > GDB_VERSION :=3D 11.1 >=20 > I rebuilt the JtagDue firmware, release LTO -g3, and checked in the build > log that -g3 was actually being passed to GCC. >=20 > Then I loaded the firmware with: >=20 > "$HOME/rdiez/arduino/JtagDue/SelfTestOutput/CurrentToolchain/bin/arm-none- > eabi-gdb" "firmware-release-lto-g3.elf" >=20 > The GDB commands I typed were: >=20 > print BareMetalSupport_Reset_Handler > info macro STACK_SIZE >=20 > There was neither a delay nor a high memory consumption. But the #define > macros were not visible with GDB. Command "info macro" yields the followi= ng > error message: >=20 > The symbol `STACK_SIZE' has no definition as a C/C++ preprocessor macro >=20 > I then built a debug build (without LTO) and the results were the same: no > #define macros were visible with GDB. >=20 > Am I doing something wrong? I cannot remember how I viewed C preprocessor > macros inside GDB in the past. >=20 > I checked, and macros are present in the debug information, as this comma= nd > confirms: >=20 > readelf --debug-dump "firmware-release-lto-g3.elf" | grep STACK_SIZE >=20 > The output is: >=20 > DW_MACRO_define_strp - lineno : 64 macro : STACK_SIZE ( 4 * 1024 ) >=20 > I'll try to attach the ELF files after this comment. >=20 > I cannot test with GDB 11.1 or 11.2 because of the cross-compilation > toolchain build problem described in this bug comment: >=20 > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98324#c7 This works: $./gdb -nx -q --data-directory=3Ddata-directory /tmp/yo/firmware-debug-g3.e= lf -ex "list SysTick_Handler" -ex "info macro STACK_SIZE" -batch=20 297 /home/rdiez/rdiez/arduino/JtagDue/Project/JtagFirmware/Main.cpp: No such file or directory. Defined at /home/rdiez/rdiez/arduino/JtagDue/Project/JtagFirmware/Main.cpp:= 64 #define STACK_SIZE ( 4 * 1024 ) You "print BareMetalSupport_Reset_Handler" doesn't set the "current locatio= n".=20 I don't see a DWARF symbol for that, just an ELF symbol. "list SysTick_handler" does it. It doesn't work with the LTO binary, I don't have time to dig into it: $ ./gdb -nx -q --data-directory=3Ddata-directory /tmp/yo/firmware-release-lto-g3.elf -ex "list SysTick_Handler" -ex "info ma= cro STACK_SIZE" -batch file: "/home/rdiez/rdiez/arduino/JtagDue/Project/JtagFirmware/Main.cpp", li= ne number: 342, symbol: "SysTick_Handler" 337 /home/rdiez/rdiez/arduino/JtagDue/Project/JtagFirmware/Main.cpp: No such file or directory. file: "/home/rdiez/rdiez/arduino/xdk-asf-3.51.0/thirdparty/CMSIS/Include/cmsis_gc= c.h", line number: 142, symbol: "SysTick_Handler()" 137=20=20=20=20 /home/rdiez/rdiez/arduino/xdk-asf-3.51.0/thirdparty/CMSIS/Include/cmsis_gcc= .h: No such file or directory. The symbol `STACK_SIZE' has no definition as a C/C++ preprocessor macro at :-1 --=20 You are receiving this mail because: You are on the CC list for the bug.=