[Dwarf-Discuss] pubnames

Andrew Cagney andrew.cagney@gmail.com
Tue Feb 3 18:19:06 GMT 2009


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
.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; ...".



On Tue, Jan 13, 2009 at 4:09 PM, Tom Tromey <tromey at redhat.com> wrote:
>>>>>> "Andrew" == Andrew Cagney <andrew.cagney at gmail.com> writes:
>
>>> In the case of the name of a function member or static data member
>>> of a C++ structure, class or union, the name presented in the
>>> .debug_pubnames section is not the simple name given by the
>>> DW_AT_name attribute of the referenced debugging entry, but rather
>>> the fully qualified name of the data or function member.
>
> Andrew> - what of enums and consts, I'm guessing, since there's no concrete
> Andrew> object these don't need to be represented
>
> It would be useful to have enum constants in the pubnames table.
> At least, my understanding is that the point of pubnames is to provide
> an index to speed up searches by name.  If enum constant names are
> omitted, it means that certain searches cannot use this mechanism.
>
> Tom
>




More information about the Dwarf-discuss mailing list