public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/29106] New: new DWARF reader should de-duplicate functions
@ 2022-04-29 19:52 tromey at sourceware dot org
  2022-04-29 20:09 ` [Bug symtab/29106] " tromey at sourceware dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-04-29 19:52 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29106

            Bug ID: 29106
           Summary: new DWARF reader should de-duplicate functions
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: tromey at sourceware dot org
  Target Milestone: ---

In https://sourceware.org/pipermail/gdb-patches/2022-April/188400.html,
Pedro pointed out that, even with the patch in that thread,
the new DWARF reader still generates a larger index:

In the old indexer, with an index of a gdb from before the indexer rewrite, we
had:

 [369902] intrusive_list<inferior, intrusive_base_node<inferior> >::begin:
          9 [global, function]
          255 [global, function]

while in the new indexer, for the same function, we have:

 [369902] intrusive_list<inferior, intrusive_base_node<inferior> >::begin:
         9 [global, function]
         79 [global, function]
         165 [global, function]
         167 [global, function]
[ ... many more instances ... ]

I suspect this is due to the old handling of DW_AT_inline.
See https://sourceware.org/pipermail/gdb-patches/2022-April/188557.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug symtab/29106] new DWARF reader should de-duplicate functions
  2022-04-29 19:52 [Bug symtab/29106] New: new DWARF reader should de-duplicate functions tromey at sourceware dot org
@ 2022-04-29 20:09 ` tromey at sourceware dot org
  2022-05-13 14:20 ` tromey at sourceware dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-04-29 20:09 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29106

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug symtab/29106] new DWARF reader should de-duplicate functions
  2022-04-29 19:52 [Bug symtab/29106] New: new DWARF reader should de-duplicate functions tromey at sourceware dot org
  2022-04-29 20:09 ` [Bug symtab/29106] " tromey at sourceware dot org
@ 2022-05-13 14:20 ` tromey at sourceware dot org
  2022-07-13 16:49 ` tromey at sourceware dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-05-13 14:20 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29106

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
In a follow-up email, Pedro said:

Hmm, inlines was my original suspicion, but seeing that setting a breakpoint at
"intrusive_list<inferior, intrusive_base_node<inferior> >::begin", even with
-readnow gives you 2 locations, same number of locations as entries in the old
index,
could it be that this is more about declarations vs definitions?  There's that
check for
has_pc_info or has_range_info too.


So this ought to be investigated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug symtab/29106] new DWARF reader should de-duplicate functions
  2022-04-29 19:52 [Bug symtab/29106] New: new DWARF reader should de-duplicate functions tromey at sourceware dot org
  2022-04-29 20:09 ` [Bug symtab/29106] " tromey at sourceware dot org
  2022-05-13 14:20 ` tromey at sourceware dot org
@ 2022-07-13 16:49 ` tromey at sourceware dot org
  2022-09-23 17:48 ` tromey at sourceware dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-07-13 16:49 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29106

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |29366


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=29366
[Bug 29366] [meta] New DWARF indexer meta bug
-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug symtab/29106] new DWARF reader should de-duplicate functions
  2022-04-29 19:52 [Bug symtab/29106] New: new DWARF reader should de-duplicate functions tromey at sourceware dot org
                   ` (2 preceding siblings ...)
  2022-07-13 16:49 ` tromey at sourceware dot org
@ 2022-09-23 17:48 ` tromey at sourceware dot org
  2022-09-23 19:38 ` tromey at sourceware dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-09-23 17:48 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29106

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
It does seem that the declarations end up in the symbol table.
In one CU, there's a concrete instance like:

 <1><28afba>: Abbrev Number: 40 (DW_TAG_subprogram)
    <28afbb>   DW_AT_specification: <0x27d5e2>

... pointing back at the method declaration.
Both the old and new gdb will emit an index entry for this.

However, in another CU, there's the same declaration but
with no concrete instance -- and here, the old gdb does
not emit an entry, but the new one does.

I suspect these declarations shouldn't be in the cooked index
at all.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug symtab/29106] new DWARF reader should de-duplicate functions
  2022-04-29 19:52 [Bug symtab/29106] New: new DWARF reader should de-duplicate functions tromey at sourceware dot org
                   ` (3 preceding siblings ...)
  2022-09-23 17:48 ` tromey at sourceware dot org
@ 2022-09-23 19:38 ` tromey at sourceware dot org
  2022-09-23 19:44 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-09-23 19:38 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29106

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
Further searching shows that the second CU in question has:

 <1><d94e58>: Abbrev Number: 24 (DW_TAG_subprogram)
    <d94e59>   DW_AT_specification: <0xd5c48b>
    <d94e5d>   DW_AT_object_pointer: <0xd94e77>
    <d94e61>   DW_AT_low_pc      : 0x0
    <d94e69>   DW_AT_high_pc     : 0x28
    <d94e71>   DW_AT_frame_base  : 1 byte block: 9c     (DW_OP_call_frame_cfa)
    <d94e73>   DW_AT_call_all_tail_calls: 1
    <d94e73>   DW_AT_sibling     : <0xd94e84>

The new index seems more correct to me, and in particular the
old gdb index does:

(gdb) break intrusive_list<inferior, intrusive_base_node<inferior> >::begin()
const
Breakpoint 1 at 0x4ac474: intrusive_list<inferior,
intrusive_base_node<inferior> >::begin() const. (4 locations)


Whereas with the new index we get:

(gdb) break intrusive_list<inferior, intrusive_base_node<inferior> >::begin()
const
Breakpoint 1 at 0x4ac474: intrusive_list<inferior,
intrusive_base_node<inferior> >::begin() const. (58 locations)

So I tend to think the old gdb was missing some locations.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug symtab/29106] new DWARF reader should de-duplicate functions
  2022-04-29 19:52 [Bug symtab/29106] New: new DWARF reader should de-duplicate functions tromey at sourceware dot org
                   ` (4 preceding siblings ...)
  2022-09-23 19:38 ` tromey at sourceware dot org
@ 2022-09-23 19:44 ` tromey at sourceware dot org
  2022-09-23 20:45 ` tromey at sourceware dot org
  2022-10-18 18:31 ` tromey at sourceware dot org
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-09-23 19:44 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29106

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
FWIW with -readnow I get 58 locations, but with ordinary "gdb"
(a /bin/gdb from before the new DWARF reader), I just get 4 locations.
So maybe the older index was a side effect of some kind
of erroneous duplication in partial symtabs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug symtab/29106] new DWARF reader should de-duplicate functions
  2022-04-29 19:52 [Bug symtab/29106] New: new DWARF reader should de-duplicate functions tromey at sourceware dot org
                   ` (5 preceding siblings ...)
  2022-09-23 19:44 ` tromey at sourceware dot org
@ 2022-09-23 20:45 ` tromey at sourceware dot org
  2022-10-18 18:31 ` tromey at sourceware dot org
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-09-23 20:45 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29106

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.1

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug symtab/29106] new DWARF reader should de-duplicate functions
  2022-04-29 19:52 [Bug symtab/29106] New: new DWARF reader should de-duplicate functions tromey at sourceware dot org
                   ` (6 preceding siblings ...)
  2022-09-23 20:45 ` tromey at sourceware dot org
@ 2022-10-18 18:31 ` tromey at sourceware dot org
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-10-18 18:31 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29106

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
As part of another bug, I looked into this some more:

https://sourceware.org/pipermail/gdb-patches/2022-October/192662.html

In particular I generated a .gdb_index for a copy of gdb,
using both the old and new gdb (that is, before and after
the new DWARF reader).  Then I compared the list of symbols.

In every case I checked, the new gdb was correct.  (Well, to be
clear, there was one case that was incorrect, but I landed
a patch to fix this.)

So, I tend to think that the old index was simply missing some
entries, and nobody noticed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-10-18 18:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29 19:52 [Bug symtab/29106] New: new DWARF reader should de-duplicate functions tromey at sourceware dot org
2022-04-29 20:09 ` [Bug symtab/29106] " tromey at sourceware dot org
2022-05-13 14:20 ` tromey at sourceware dot org
2022-07-13 16:49 ` tromey at sourceware dot org
2022-09-23 17:48 ` tromey at sourceware dot org
2022-09-23 19:38 ` tromey at sourceware dot org
2022-09-23 19:44 ` tromey at sourceware dot org
2022-09-23 20:45 ` tromey at sourceware dot org
2022-10-18 18:31 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).