[Bug gdb/23710] New: gdb is slow and memory hungry consuming debug generated with LTO by GCC

classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/23710] gdb is slow and memory hungry consuming debug generated with LTO by GCC

Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=23710

--- Comment #16 from rdiezmail-binutils at yahoo dot de ---
I develop a relative small firmware for ARM Cortex-M4F since some years ago,
and I did not notice any slowdown up to and including GCC 8.3 and GDB 8.3.

In the past months, I upgraded my toolchain to GCC 9.3 and GDB 9.2, and then I
started noticing a big slowdown of several seconds on the first "hbreak
myfunction" command. I guess that is the first time that GDB loads the symbols.

The slowdown only happens with release builds compiled with LTO. With debug
builds (with asserts and without LTO), GDB start-up is instantaneous.

These are the GDB RAM usage stats I collected:

Debug    firmware build: VSZ: 101 MiB, RSS  33 MiB.
Release  firmware build: VSZ: 430 MiB, RSS 362 MiB.

I do not understand why this difference, because it is exactly the same
firmware. The LTO build is smaller and faster, but it has the same symbols (or
less, because asserts etc. are per "#ifndef NDEBUG" no longer there).

I hope the patches above fix this issue. But I would say that the GDB's
handling of LTO builds would not need a 30 % speed increase, but more like a 10
fold improvement.

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