Ok for gdb, load time was major pain.
Ah, for large binaries you probably want to compile with
-ggnu-pubnames -Wl,--gdb-index (you must compile with this for Split
DWARF - it relies on the index) that takes, for instance, gdb startup
time debugging clang from 3 minutes to about 3 seconds. (lldb does a
better job lazy loading DWARF - so faster startup time even without an
index (& it can't use the gdb index anyway) trading off some
operations later will be slower as things are lazy loaded later on)
Type casting was patchy some types missing etc,
Hard to say what's at work there - happy to speculate/help if you have
a specific/isolated example.
some var tracking especially under optimizations was tricky for example having to cast registers because info this var is stored in this register was missing
Yeah, that's less about the workflow/technology, but more as we like
to say, the "quality of implementation" - keeping track of variables
under optimization is tricky, and different compilers do it
well/poorly - DWARF certainly offers a good variety of ways to express
these things (and gaining more as DWARF improves - it's certainly not
"complete", but I don't think it ever can be - there'll always be more
cunning optimizations and cunning ways to try to recover the value of
user variables under those optimizations).
hmm also one mire thing that could minimize debug info size could be shared types section with removing local copies per compilation unit.
Yep - that can already be done with DWARF type units
(-fdebug-types-section), but also various strategies to reduce
emitting the types in the first place (hopefully we'll be enabling the
constructor homing strategy by default soon which should reduce
duplicate type information significantly)
Also global vars etc could be stored in shared segment. Also we could think of somehow indexing the db.
Yeah, as mentioned above, gdb (& lld and gold) support the gdb_index
format and that can be generated at link time with -Wl,--gdb-index
(objects need to be compiled with -ggnu-pubnames (that comes by
default if you specify -gsplit-dwarf I think... ) for this to work).
And there is a DWARFv5 debug_names section, but it's not fully
supported yet (we don't have any linker that supports merging
.debug_names from object files into a unified .debug_names in the
linked binary - nor any debuggers that can consume the .debug_names
index).