From Fedora Project Wiki

< Features

Revision as of 22:35, 29 June 2010 by Tromey (talk | contribs) (update status)

GdbIndex

Summary

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.

Owner

  • Email: tromey@redhat.com

Current status

  • Targeted release: Releases/14
  • Last updated: 2010-06-11
  • Percentage of completion: 33%


Detailed Description

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.

Scope

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 submitted and is pending review.
  • 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.

User Experience

Users will notice a drastic speedup when debugging executables or libraries that have an index.

Dependencies

Various programs depend on DWARF: valgrind, elfutils, binutils, gdb, dwarves.

This will also affect gcc and whatever package strips debuginfo.

Contingency Plan

No contingency plan is necessary.

Documentation

The existing indices are described in the DWARF standard.

The new index file is described only by a comment in the gdb sources.

Release Notes

Comments and Discussion