This is the mail archive of the gdb-patches@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]

Re: gdb: Incorrect stack unwinding if compressed debug info is used


On 02/04/2011 07:34 PM, Tom Tromey wrote:
"Vladimir" == Vladimir Simonov<sv@sw.ru> writes:

Vladimir> I've spend some time and, looks like, found the problem. It is in Vladimir> dwarf2_symbol_mark_computed function (dwarf2read.c). Check Vladimir> "DW_UNSND (attr)< dwarf2_per_objfile->loc.size" Vladimir> is incorrect if compressed section is used.

Thanks for finding this.

Since fill_in_loclist_baton is going to read the loc section right away
anyhow, it seems to me that it is simpler to just have
dwarf2_symbol_mark_computed do it.

Could you try the appended?

All is OK with it.
I'd also suggest to remove dwarf2_read_section from
fill_in_loclist_baton. Without it all works ok also.

But resulted code looks a bit hackish:
dwarf2_symbol_mark_computed (...)
{
  if (attr_form_is_section_offset (attr))
     /* We need to read the section before we can check its size,
        because the size is only valid once the section is
        uncompressed.  */
     dwarf2_read_section (dwarf2_per_objfile->objfile,
  		 &dwarf2_per_objfile->loc);
  if (attr_form_is_section_offset (attr)
      ........
       && DW_UNSND (attr)<  dwarf2_per_objfile->loc.size)
  )
  {
     ....
     fill_in_loclist_baton /* which uses results of dwarf2_read_section */
     ....
  }
...

Regards
Vladimir


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