Features/GdbIndex

From FedoraProject

< Features(Difference between revisions)
Jump to: navigation, search
(ready for wrangler)
 
(6 intermediate revisions by 3 users not shown)
Line 13: Line 13:
 
== Current status ==
 
== Current status ==
 
* Targeted release: [[Releases/14]]  
 
* Targeted release: [[Releases/14]]  
* Last updated: 2010-07-09
+
* Last updated: 2010-09-15
* Percentage of completion: 80%
+
* Percentage of completion: 100%
  
 
<!-- CHANGE THE "FedoraVersion" TEMPLATES ABOVE TO PLAIN NUMBERS WHEN YOU COMPLETE YOUR PAGE. -->
 
<!-- CHANGE THE "FedoraVersion" TEMPLATES ABOVE TO PLAIN NUMBERS WHEN YOU COMPLETE YOUR PAGE. -->
Line 54: Line 54:
  
 
== Documentation ==
 
== Documentation ==
The existing indices are described in the DWARF standard.
+
The existing indices are described in the [http://dwarfstd.org/ DWARF standard].
  
The new index file is described only by a comment in the gdb sources.
+
The new index file is described only by [http://sourceware.org/ml/gdb-patches/2010-06/msg00696.html a comment] in the gdb sources.
 +
 
 +
gdb-7.2-3.fc14 or later is required.  To cover also glibc by .gdb_index the Koji buildroot will need to include elfutils-0.149-1.fc14 ([https://bugzilla.redhat.com/show_bug.cgi?id=631997|Bug 631997]).  There has been no mass rebuild with .gdb_index and therefore some F14 rpms still do not feature .gdb_index.
  
 
== Release Notes ==
 
== Release Notes ==
 
<!-- The Fedora Release Notes inform end-users about what is new in the release.  Examples of past release notes are here: http://docs.fedoraproject.org/release-notes/ -->
 
<!-- The Fedora Release Notes inform end-users about what is new in the release.  Examples of past release notes are here: http://docs.fedoraproject.org/release-notes/ -->
 
<!-- The release notes also help users know how to deal with platform changes such as ABIs/APIs, configuration or data file formats, or upgrade concerns.  If there are any such changes involved in this feature, indicate them here.  You can also link to upstream documentation if it satisfies this need.  This information forms the basis of the release notes edited by the documentation team and shipped with the release. -->
 
<!-- The release notes also help users know how to deal with platform changes such as ABIs/APIs, configuration or data file formats, or upgrade concerns.  If there are any such changes involved in this feature, indicate them here.  You can also link to upstream documentation if it satisfies this need.  This information forms the basis of the release notes edited by the documentation team and shipped with the release. -->
*
+
* gdb has been enhanced to remove the unncecssary indices from the .debug files, and will replace them with an index that greatly speeds up gdb.
  
 
== Comments and Discussion ==
 
== Comments and Discussion ==
Line 67: Line 69:
  
  
[[Category:FeatureReadyForWrangler]]
+
[[Category:FeatureAcceptedF14]]
 
<!-- When your feature page is completed and ready for review -->
 
<!-- When your feature page is completed and ready for review -->
 
<!-- remove Category:FeaturePageIncomplete and change it to Category:FeatureReadyForWrangler -->
 
<!-- remove Category:FeaturePageIncomplete and change it to Category:FeatureReadyForWrangler -->
 
<!-- After review, the feature wrangler will move your page to Category:FeatureReadyForFesco... if it still needs more work it will move back to Category:FeaturePageIncomplete-->
 
<!-- After review, the feature wrangler will move your page to Category:FeatureReadyForFesco... if it still needs more work it will move back to Category:FeaturePageIncomplete-->
 
<!-- A pretty picture of the page category usage is at: https://fedoraproject.org/wiki/Features/Policy/Process -->
 
<!-- A pretty picture of the page category usage is at: https://fedoraproject.org/wiki/Features/Policy/Process -->

Latest revision as of 20:15, 16 September 2010

Contents

[edit] GdbIndex

[edit] 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.

[edit] Owner

  • Email: tromey@redhat.com

[edit] Current status

  • Targeted release: Releases/14
  • Last updated: 2010-09-15
  • Percentage of completion: 100%


[edit] 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".

[edit] 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.

[edit] Scope

The work consists of three separate parts:

  • Modify gdb to create and use an index. This is complete and submitted to upstream GDB. It will end up in the Fedora GDB RPM either via upstream or as a (temporary) Fedora patch.
  • 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.

[edit] 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.

[edit] User Experience

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

[edit] Dependencies

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

This will also affect gcc and whatever package strips debuginfo.

[edit] Contingency Plan

No contingency plan is necessary.

[edit] Documentation

The existing indices are described in the DWARF standard.

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

gdb-7.2-3.fc14 or later is required. To cover also glibc by .gdb_index the Koji buildroot will need to include elfutils-0.149-1.fc14 (631997). There has been no mass rebuild with .gdb_index and therefore some F14 rpms still do not feature .gdb_index.

[edit] Release Notes

  • gdb has been enhanced to remove the unncecssary indices from the .debug files, and will replace them with an index that greatly speeds up gdb.

[edit] Comments and Discussion