This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug symtab/21095] New: gdb_index generated by gold causes "Couldn't find method"


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

            Bug ID: 21095
           Summary: gdb_index generated by gold causes "Couldn't find
                    method"
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: atotic at chromium dot org
  Target Milestone: ---

gdb version: GNU gdb (GDB) 7.9-gg19
gold version: GNU gold (GNU Binutils 2.26.20160125) 1.11

TL;DR
Trying to eval a method results in "Couldn't find method" when
debugging libraries linked with gold's gdb_index option.

Details:

I debug Chromium with gdb. I use gold linker's gdb_index option
to speed up my gdb startup time. Chromium has lots of shared libraries,
and they all get their own gdb_index.

Everything works fine when I do not use gold to generate gdb_index.
For example:
1) not using gdb_index at all works
2) generating gdb_index using gdb save gdb-index && objcopy works.

The gold setup worked fine for a few months, but recently I've started
running into problems where gdb can't evaluate methods because
it can't find them in superclass chain.

An example:

Running Chromium, gold gdb_index = true

The program is stopped in a method blink::NGBlockNode::Layout()
'this' is NGBlockNode*
this->layout_box_ is LayoutBox*
LayoutBox inheriths method debugName() from superclass LayoutObject.

(gdb) p this->layout_box_->debugName()
Couldn't find method blink::LayoutBox::debugName

(gdb) p *this->layout_box_
$3 = <incomplete type>

I've discovered a workaround:

If I set breakpoints in constructors of LayoutBox superclass
chain, the methods become reachable.

(gdb) br blink::LayoutBox::LayoutBox
Breakpoint 2 at 0x7f2e1e7b8870 (2 locations)

(gdb) p *this->layout_box_
$5 = {
  <blink::LayoutBoxModelObject> = {<No data fields>},
  members of blink::LayoutBox:
  m_frameRect = {.......
(gdb) br blink::LayoutObject::LayoutObject
Breakpoint 4 at 0x7f2e1e7ba8b0 (2 locations)
(gdb) p this->layout_box_->debugName()
$6 = "LayoutBlockFlow HTML"

Investigation:

I've tried to compare gdb_index generated by gdb, and by gold.
I dump the indexes with:

> objdump --dwarf=gdb_index

They look very different.

gdb_index produced by gold is 1.7MB, filled with lines
that look suspicions such as:

[3115] SafeReadBits: 2828 [no symbol information]
[3117] axisAttributeGetter: 2261 [no symbol information]
[3119] returnValueAttributeSetterCallback:
  2158 [no symbol information]
  2164 [no symbol information]
  2213 [no symbol information]

gdb_index generated by gdb is 7MB, and looks reasonable:

[155610] blink::EventTypeNames::cached: 113 [global variable]
[155612] blink::Member<blink::CSSRuleList>::Member: 287 [global function]
[155613] blink::installV8HTMLDataListElementTemplate: 2211 [static function]
[155618] blink::GarbageCollected<blink::HTMLParserScheduler>::operator new:
1103 [global function]

I'd be happy to help work on this.

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]