[Lldb-commits] [PATCH] DWARF64 Fixes

Tong Shen endlessroad at google.com
Wed Sep 10 19:11:12 PDT 2014


Remove llvm-commits, add lldb-commits...

Thanks for the review!

> In DWARFDebugInfoEntry.cpp DW_FORM_ref_addr you use cu->GetAddressByteSize() for the size (or cu_addr_size, used in a different part of the file) -- but if this is a 64-bit binary using DWARF32, that would be wrong - this is a reference to another part of the DWARF.  Or a 32-bit binary using DWARF64.  Don't you want to do cu->IsDWARF64() (like you do for DW_FORM_strp / DW_FORM_sec_offset)?

Ahh my bad... Just thought ref_addr should be more or less similar to addr.
I checked DWARF spec: http://www.dwarfstd.org/doc/DWARF4.pdf     Page 142,
In DWARF 4, DW_FORM_ref_addr is 8 for DWARF64, 4 for DWARF32.

> (or more accurately, for DWARF2, the DW_FORM_ref_addr is apparently the word size of the program; with DWARF3+, it's 4 for DWARF32, 8 for DWARF64)

OK, I will change accordingly.

> I see what you're doing in DWARFFormValue::GetFixedFormSizesForAddressSize -- you assume that 32-bit-program + DWARF64 is not a possible combination.  That's fine, I don't really think any producer would generate it.

Oh yes. I will add a comment about it.

>
> Greg might not want to see this change to DWARFAbbreviationDeclaration::Dump() ;) but I don't have an opinion on that.
>
> Otherwise it looks fine to me.
>
>
>
>> On Sep 10, 2014, at 6:30 PM, Tong Shen <endlessroad at google.com> wrote:
>>
>> Hi tfiala, jasonmolenda,
>>
>> 1. DW_FORM_strp and DW_FORM_sec_offset are 64bits for DWARF64 / 32bits for DWARF32
>> They are different from DW_FORM_addr, whose size is specified in .debug_info
>>
>> 2. Bump DWARF version support form [2,3] to [2,4] in DWARFDebugLine.cpp
>>
>> 3. Fix DWARFDebugLine to support DWARF64
>>
>> http://reviews.llvm.org/D5307
>>
>> Files:
>>  source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
>>  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
>>  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
>>  source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
>>  source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
>>  source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
>>  source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
>>  source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
>>  source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
>>  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
>> <D5307.13572.patch>
>



-- 
Best Regards, Tong Shen




More information about the lldb-commits mailing list