[LLVMdev] DW_AT_low_pc in compile unit
Arsen Hakobyan
artinetstudio at gmail.com
Mon May 18 23:04:31 PDT 2015
Hi all,
I am using the LLVM compiler to generate DWARF version 2 (passing -gdwarf-2
flag to the compiler).
In the documentation (see DWARF 2 standard, section 3.1 Compilation Unit
Entries <http://www.dwarfstd.org/doc/dwarf-2.0.0.pdf> ) it says:
The presence of low and high pc attributes in a compilation unit entry imply
that the code
generated for that compilation unit is contiguous and exists totally within
the boundaries
specified by those two attributes. If that is not the case, no low and high
pc attributes
should be produced.
Starting with DWARF version 3 there is a new representation described in
section 2.17 Code Addresses and Ranges (see DWARF standard version 3
<http://www.dwarfstd.org/doc/Dwarf3.pdf> )
Looking in the Compiler sources I found that it works according to the newer
standard without any checking of the used version:
In the function "DwarfDebug::constructCompileUnit" from the file
"lib/CodeGen/AsmPrinter/DwarfDebug.cpp":
// 2.17.1 requires that we use DW_AT_low_pc for a single entry point
// into an entity. We're using 0 (or a NULL label) for this. For
// split dwarf it's in the skeleton CU so omit it here.
if (!useSplitDwarf())
NewCU->addLabelAddress(Die, dwarf::DW_AT_low_pc, NULL);
I didn't find any DW_AT_high_pc attribute generation here for the compile
unit.
I may didn't understand these attributes that is why the mentioned above
seems to me is a bug (or at least inconsistent to the DWARF 2 standard).
So I will appreciate any comments or links describing in details (with cases
if possible) these low/high_pc attributes' meaning and contiguous/not
contiguous compile unit.
Thanks,
Arsen
--
View this message in context: http://llvm.1065342.n5.nabble.com/DW-AT-low-pc-in-compile-unit-tp81478.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.
More information about the llvm-dev
mailing list