[Dwarf-Discuss] pubnames

David Anderson davea42@earthlink.net
Tue Feb 3 19:36:03 GMT 2009

I added workgroup to the list.  Perhaps I should have removed dwarf-discuss?

Andrew Cagney wrote:
> Can you give an example of how enums in .debug_pubnames would be used?
> I tried to work through several scenarios:
> - given something like:
>     print a::name
> since we can't assume it is fully qualified (and use .debug_pubnames
> as a cheat) we must first resolve it using the current context's

That's not quite true.  A debugger-writer can use .debug_pubnames for 
the above.
Because she can (if  she chooses) do comparisons with the 'tail' of each
fully qualified name in .debug_pubnames.   Even if a::name  appears more 
than once it
will likely (?) only appear in a limited number of  entries, limiting 
the places
one might want to further investigate .debug_info.

Vaguely similar  to how debuggers usually find file-static variables.

> .debug_info; in the case of an enum the .debug_info's name/scope
> information will yield the enum's value eliminating any reason to
> refer to .debug_pubnames.
> - given something like:
>     break a::function
> then the context's .debug_info could yield a fully-qualified-name like
> "name::of::a::function", and each module's .debug_pubnames could be
> searched for concrete instances of that function using the FQN, and
> breakpoints set accordingly.
> Section 5.1 Accelerated Access
> ``A debugger frequently needs to find the debugging information for a
> program entity defined outside of the compilation unit where the
> debugged program is currently stopped. Sometimes  the debugger will
> know only the name of the entity; sometimes only the address. To find
> the debugging information associated with a global entity by name,
> using the DWARF debugging information entries alone, a debugger would
> need to run through all entries at the highest scope within each
> compilation unit.''
> I think, hints at this.  Perhaps it should read "... only know the
> /fully qualified/ name of the entity; ...".
So it's not quite true that /fully qualified/ is required (of the user)
so the debugger can use .debug_pubnames.  So I don't think the
paragraph above needs the change suggested above.

A clarification like you mentioned in later email

   Should the DWARF spec be clarified by adding:
      ... but rather the fully qualified name /(which includes the
   namespace)/ of the data or function member.

(a clarification for the compiler writer)  would be fine with me.  Namespaces
nest so a singular 'the namespace' is not totally clear though...

David Anderson

More information about the Dwarf-discuss mailing list