public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "simark at simark dot ca" <sourceware-bugzilla@sourceware.org>
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	[thread overview]
Message-ID: <bug-27754-4717-iqL1XGRX9z@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27754-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=27754

--- Comment #20 from Simon Marchi <simark at simark dot ca> ---
(In reply to rdiezmail-binutils from comment #18)
> I just did another test after upgrading the toolchain to these versions:
> 
> BINUTILS_VERSION := 2.37
> GMP_VERSION := 6.2.1
> MPFR_VERSION := 4.1.0
> MPC_VERSION := 1.2.1
> GCC_VERSION := 10.3.0
> NEWLIB_VERSION := 4.1.0
> GDB_VERSION := 11.1
> 
> I rebuilt the JtagDue firmware, release LTO -g3, and checked in the build
> log that -g3 was actually being passed to GCC.
> 
> Then I loaded the firmware with:
> 
> "$HOME/rdiez/arduino/JtagDue/SelfTestOutput/CurrentToolchain/bin/arm-none-
> eabi-gdb"  "firmware-release-lto-g3.elf"
> 
> The GDB commands I typed were:
> 
> print BareMetalSupport_Reset_Handler
> info macro STACK_SIZE
> 
> There was neither a delay nor a high memory consumption. But the #define
> macros were not visible with GDB. Command "info macro" yields the following
> error message:
> 
> The symbol `STACK_SIZE' has no definition as a C/C++ preprocessor macro
> 
> I then built a debug build (without LTO) and the results were the same: no
> #define macros were visible with GDB.
> 
> Am I doing something wrong? I cannot remember how I viewed C preprocessor
> macros inside GDB in the past.
> 
> I checked, and macros are present in the debug information, as this command
> confirms:
> 
> readelf --debug-dump "firmware-release-lto-g3.elf"  | grep STACK_SIZE
> 
> The output is:
> 
> DW_MACRO_define_strp - lineno : 64 macro : STACK_SIZE ( 4 * 1024 )
> 
> I'll try to attach the ELF files after this comment.
> 
> I cannot test with GDB 11.1 or 11.2 because of the cross-compilation
> toolchain build problem described in this bug comment:
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98324#c7

This works:

$./gdb -nx -q --data-directory=data-directory /tmp/yo/firmware-debug-g3.elf -ex
"list SysTick_Handler" -ex "info macro STACK_SIZE" -batch 
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 location". 
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=data-directory
/tmp/yo/firmware-release-lto-g3.elf -ex "list SysTick_Handler" -ex "info macro
STACK_SIZE" -batch
file: "/home/rdiez/rdiez/arduino/JtagDue/Project/JtagFirmware/Main.cpp", line
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_gcc.h",
line number: 142, symbol: "SysTick_Handler()"
137    
/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 <user-defined>:-1

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-12-23  2:48 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 16:03 [Bug gdb/27754] New: " rdiezmail-binutils at yahoo dot de
2021-04-19 16:04 ` [Bug gdb/27754] " rdiezmail-binutils at yahoo dot de
2021-04-19 17:02 ` dblaikie at gmail dot com
2021-04-19 17:07 ` psmith at gnu dot org
2021-04-23 18:38 ` tromey at sourceware dot org
2021-04-23 18:56 ` tromey at sourceware dot org
2021-04-23 20:31 ` rdiezmail-binutils at yahoo dot de
2021-04-23 20:52 ` dblaikie at gmail dot com
2021-05-06 11:13 ` rguenth at gcc dot gnu.org
2021-05-06 11:45 ` rdiezmail-binutils at yahoo dot de
2021-05-06 12:34 ` rdiezmail-binutils at yahoo dot de
2021-05-10 14:27 ` [Bug macros/27754] " tromey at sourceware dot org
2021-05-10 14:51 ` tromey at sourceware dot org
2021-05-10 20:30 ` tromey at sourceware dot org
2021-05-11  8:15 ` rguenth at gcc dot gnu.org
2021-05-11  8:19 ` jakub at redhat dot com
2021-05-12 20:37 ` simark at simark dot ca
2021-05-12 20:38 ` simark at simark dot ca
2021-05-13 17:20 ` tromey at sourceware dot org
2021-05-13 17:26 ` jakub at redhat dot com
2021-05-13 17:31 ` simark at simark dot ca
2021-12-21 21:25 ` rdiezmail-binutils at yahoo dot de
2021-12-21 21:26 ` rdiezmail-binutils at yahoo dot de
2021-12-22 20:27 ` ssbssa at sourceware dot org
2021-12-23  2:48 ` simark at simark dot ca [this message]
2021-12-23 16:36 ` ssbssa at sourceware dot org
2022-10-25 16:16 ` tromey at sourceware dot org
2022-10-25 16:16 ` tromey at sourceware dot org
2022-10-25 16:19 ` tromey at sourceware dot org
2022-10-25 16:43 ` rdiezmail-binutils at yahoo dot de
2022-10-25 16:58 ` rajpal.gusain at gmail dot com
2022-11-17 20:04 ` pedro at palves dot net
2022-11-18  2:24 ` tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-27754-4717-iqL1XGRX9z@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).