[haiku-bugs] Re: [Haiku] #8190: Debugger doesn't correctly handle anonymous unions within structs/classes

  • From: "anevilyak" <trac@xxxxxxxxxxxx>
  • Date: Thu, 08 Dec 2011 02:31:43 -0000

#8190: Debugger doesn't correctly handle anonymous unions within structs/classes
-------------------------------------+----------------------------
   Reporter:  anevilyak              |      Owner:  anevilyak
       Type:  bug                    |     Status:  assigned
   Priority:  normal                 |  Milestone:  R1
  Component:  Applications/Debugger  |    Version:  R1/Development
 Resolution:                         |   Keywords:
 Blocked By:                         |   Blocking:
Has a Patch:  0                      |   Platform:  All
-------------------------------------+----------------------------

Comment (by anevilyak):

 Problem found:

 In DwarfTypeFactory::CreateType(), we call GetFullyQualifiedDIEName() on
 the type entry. The latter finds the entry to have no name, since it's an
 anonymous union, finds neither an abstract origin nor a specification, and
 then starts trying to build the name from the namespace. This ends up with
 the name of the parent struct, then finds that the entry has no name, and
 finishes there. Consequently we just get back the name of the parent
 struct as the fully qualified DIE name and thus find it in the type cache
 and assign that to it, leading to the observed issue. I'm not really sure
 as to the best way to fix that without breaking anything else though.
 Hypothetically, assigning it the name "<unnamed union>" while parsing the
 DIE might work, since then we'd get a name, fail to find an actual type by
 it, and then fall back to looking up the type by ID. Thoughts?

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/8190#comment:6>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: