Currently gdb startup time is slow due to the lack of usable DWARF indices. At the same time, the .debug files include indices which are not usable.
This project will remove the useless indices from the .debug files, and will replace them with an index that greatly speeds up gdb.
- Name: Tom Tromey
- Email: email@example.com
- Targeted release: Releases/14
- Last updated: 2010-06-11
- Percentage of completion: 33%
The current DWARF sections .debug_pubnames and .debug_pubtypes are not usable by gdb for various reasons: they are historically buggy (and thus unreliable), they don't include all symbols (so using them would result in user-visible behavior changes), and they do not have canonicalized C++ names (so reading them is still slow).
To the best of my knowledge no program in the distro (and probably no program anywhere) uses these sections. They are just wasted space.
A gdb branch, part of the archer project, lets gdb create an mmap()able index. This index greatly speeds up startup time. E.g., it results in a 10x improvement for "gdb gdb".
Benefit to Fedora
Removing the unused DWARF sections will save space and possible reduce compile and link times (perhaps minutely).
The index will make gdb much faster.
The work consists of three separate parts:
- Modify gdb to create and use an index. This is complete, on an archer branch. I will merge this branch into upstream gdb when this feature is accepted for Fedora.
- Change gcc not to emit the various unused indices. The patch has been checked in upstream.
- Change find-debuginfo.sh to invoke gdb to create the index when the separate debuginfo files are created. The patch has been submitted to the Fedora RPM maintainer.
How To Test
A simple test would be to time "gdb gdb", then make an index for gdb and do it again. Another test would be to examine objdump output (on just about any executable compiled with -g) to verify that the index sections do not exist.
Users will notice a drastic speedup when debugging executables or libraries that have an index.
Various programs depend on DWARF: valgrind, elfutils, binutils, gdb, dwarves.
This will also affect gcc and whatever package strips debuginfo.
No contingency plan is necessary.
The existing indices are described in the DWARF standard.
The new index file is described only by a comment in the gdb sources.