Dwarf info and .debug_pubnames section

Hi All,

I just enabled the generation of dwarf debugging information for Hexagon. It
did not require much save for the setting of a flag in MCAsmInfo.

However, now I see that the ".debug_pubnames" sections is not generated. I
did read discussion about the section not really being useful for debuggers
in terms of accelerated access, but I have code that uses libdwarf to check
for global variables. The particular libdwarf API queries the
".debug_pubnames" This code is no longer functional because my LLVM
generated executables do not seem to have the .debug_pubnames sections. From
the discussion I did not gather that the sections would be removed
completely. Is that the case ?

TIA,
Pranav

Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

Nope, it's removed completely. No debugger that I know of uses it at all and it's
useless for many reasons. Adding the code back in to generate it is possible (it's
a fairly small commit that's easily reverted), but I see no reason to have it generated
by default. What are you doing that involves looking for global variables in the pubnames
section?

-eric

Hi Eric,

Nope, it's removed completely. No debugger that I know of uses it at
all and it's
useless for many reasons. Adding the code back in to generate it is
possible (it's
a fairly small commit that's easily reverted), but I see no reason to
have it generated
by default. What are you doing that involves looking for global
variables in the pubnames
section?

Thanks for the information. After I sent out the email, I saw the patch you
reverted on viewVC. I have some proprietary code that looks at the debug
info in an executable using libdwarf; It queries the debug info on demand
with a variable name and uses dwarf_get_globals which, I believe, uses
.debug_pubnames.

I believe you made only one change to take out support for this section,
right ? I will revert that change and give it a go.

Thanks,
Pranav
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

Hi Eric,

Nope, it's removed completely. No debugger that I know of uses it at
all and it's
useless for many reasons. Adding the code back in to generate it is
possible (it's
a fairly small commit that's easily reverted), but I see no reason to
have it generated
by default. What are you doing that involves looking for global
variables in the pubnames
section?

Thanks for the information. After I sent out the email, I saw the patch you
reverted on viewVC. I have some proprietary code that looks at the debug
info in an executable using libdwarf; It queries the debug info on demand
with a variable name and uses dwarf_get_globals which, I believe, uses
.debug_pubnames.

That's odd and likely problematic. The code would be better off iterating
through anything with a DW_TAG_variable from whichever DIE you
want to iterate and looking for DW_AT_external.

Slightly longer, less likely to be buggy. (However, probably the only possible
use of the pubnames section that isn't totally useless)

I believe you made only one change to take out support for this section,
right ? I will revert that change and give it a go.

Correct. Re-enabling the pubnames section will increase the size of your
dwarf debug info quite significantly since it requires a full copy of every
string even if you're using DW_FORM_strp for strings in the rest of the
debug info.

-eric