Bug 41130 - GCC should emit an index of publicly named entities
GCC should emit an index of publicly named entities
Status: RESOLVED WONTFIX
Product: gcc
Classification: Unclassified
Component: debug
4.6.0
: P3 enhancement
: 4.5.1
Assigned To: Not yet assigned to anyone
:
: 39708 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-20 12:44 UTC by Dodji Seketeli
Modified: 2010-06-15 21:51 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-08-20 12:45:00


Attachments
First shot implementation (12.48 KB, patch)
2009-08-20 14:42 UTC, Dodji Seketeli
Details | Diff
WIP with test (15.63 KB, patch)
2009-08-24 21:40 UTC, Dodji Seketeli
Details | Diff
Generated assembly for previous test (22.16 KB, text/plain)
2009-08-24 21:42 UTC, Dodji Seketeli
Details
Updated patch (2.45 KB, patch)
2009-08-27 09:31 UTC, Dodji Seketeli
Details | Diff
Oops. (16.05 KB, patch)
2009-08-27 09:33 UTC, Dodji Seketeli
Details | Diff
modified patch (11.17 KB, patch)
2009-11-19 16:30 UTC, Tom Tromey
Details | Diff
patch for readelf (4.12 KB, patch)
2009-11-19 16:45 UTC, Tom Tromey
Details | Diff
patch for readelf (5.52 KB, patch)
2009-12-02 19:40 UTC, Tom Tromey
Details | Diff
updated gcc patch to put the CU's language in the new section (13.48 KB, patch)
2009-12-03 18:08 UTC, Tom Tromey
Details | Diff
updated binutils patch to account for language in new index (9.33 KB, patch)
2009-12-03 18:09 UTC, Tom Tromey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dodji Seketeli 2009-08-20 12:44:04 UTC
A somewhat detailed explanation of the needs and possible solution is available at http://gcc.gnu.org/wiki/DebugGNUIndexSection .

It was posted for discussion to http://sourceware.org/ml/archer/2009-q3/msg00105.html .
Comment 1 Dodji Seketeli 2009-08-20 14:42:32 UTC
Created attachment 18404 [details]
First shot implementation

Implements the .debug_gnu_index section. It fully implements the proposal, modulo the possible bugs.
For now, .debug_pubtypes and .debug_pubnames are kept around.
It patch doesn't contain any test yet. I'll update it soon with some tests.
Comment 2 Dodji Seketeli 2009-08-24 21:40:52 UTC
Created attachment 18420 [details]
WIP with test

This version fixes a bug in gcc that was preventing it to emit DWARFs for a typedefs enclosed in a namespace, if said namespace contain only typedefs.
As a matter of fact, the exemple accompanying the patch shows what's supported now. Find attached below the generated assembly fo the exemple in the patch.
Comment 3 Dodji Seketeli 2009-08-24 21:42:15 UTC
Created attachment 18421 [details]
Generated assembly for previous test

Assembly generated for the test in attachment #18420 [details]
Comment 4 Dodji Seketeli 2009-08-27 09:31:01 UTC
Created attachment 18434 [details]
Updated patch

This patch removes the addition fix that was carried by previous patch as that fix was pushed upstream, independently as PR debug/41770 .
Adjust tests to pass regtests.
Comment 5 Dodji Seketeli 2009-08-27 09:33:18 UTC
Created attachment 18435 [details]
Oops.

Okay, this is the patch I wanted to attach. Not #18434. So the previous comment applies to this entry.
Comment 6 Tom Tromey 2009-09-29 20:03:42 UTC
*** Bug 39708 has been marked as a duplicate of this bug. ***
Comment 7 Tom Tromey 2009-11-19 16:30:06 UTC
Created attachment 19055 [details]
modified patch

I've slightly updated the patch to handle non-public entities
as well.
Comment 8 Tom Tromey 2009-11-19 16:45:29 UTC
Created attachment 19056 [details]
patch for readelf

This patch modifies the binutils readelf utility to
dump the new section.
Comment 9 Tom Tromey 2009-12-02 19:40:08 UTC
Created attachment 19214 [details]
patch for readelf

This is an updated readelf patch.
Now "readelf -wI" works properly.
Comment 10 Tom Tromey 2009-12-03 18:08:11 UTC
Created attachment 19218 [details]
updated gcc patch to put the CU's language in the new section
Comment 11 Tom Tromey 2009-12-03 18:09:45 UTC
Created attachment 19219 [details]
updated binutils patch to account for language in new index
Comment 12 Tom Tromey 2009-12-03 18:16:32 UTC
I compiled a C++ program with a gcc that includes this patch.
I see some erroneous entries in the resulting index.  E.g.:

          0xb8 DW_TAG_structure_type                ._6
         0x3f1 DW_TAG_structure_type       basic_string
        0x3fc2 DW_TAG_structure_type               _Rep
Comment 13 Tom Tromey 2009-12-07 21:32:01 UTC
It would be best for gdb if gcc emitted an "empty" section if
there was nothing to index.  See PR 42288 for an analogous case.
This is worth doing even though, in this situation, the resulting
CU won't really hold much of interest.  The reason is that if all
the CUs are represented, then gdb can defer even mapping .debug_info,
which is significant.
Comment 14 Dodji Seketeli 2010-03-23 09:54:41 UTC
Not working on this atm.
Comment 15 Tom Tromey 2010-06-15 21:51:15 UTC
I think we've decided not to pursue this route.