Bug 87432 - LTO produced debug info makes gdb slow
Summary: LTO produced debug info makes gdb slow
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: lto
Depends on:
Blocks:
 
Reported: 2018-09-25 12:55 UTC by Richard Biener
Modified: 2023-01-18 21:28 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-09-25 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2018-09-25 12:55:44 UTC
For example starting gdb on LTO bootstrapped cc1 takes s and ~1.8GB memory for me.  Setting a breakpoint on do_rpo_vn takes another 3s.  That feels a lot slower than doing this on a non-LTO bootstrapped cc1.

This bug is to track what _GCC_ can do better here.
Comment 1 Richard Biener 2018-09-25 12:58:25 UTC
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87362#c6 for some profiling of gdb - the time is spent building its symbol table and the memory is likely used because it pulls in all (too many) DIEs.
Comment 2 Tom Tromey 2022-04-19 20:52:27 UTC
(In reply to Richard Biener from comment #0)
> For example starting gdb on LTO bootstrapped cc1 takes s and ~1.8GB memory
> for me.  Setting a breakpoint on do_rpo_vn takes another 3s.  That feels a
> lot slower than doing this on a non-LTO bootstrapped cc1.
> 
> This bug is to track what _GCC_ can do better here.

Note that in gdb, those are two different code paths.

We recently rewrote the initial scan to be much faster (10x improvement
isn't uncommon).  This affects the startup time.

However, setting a breakpoint currently requires a full CU expansion.
That's still probably slow.  For gdb performance the best thing for
this case is if each CU is reasonably small.