[PATCH] D26051: Import/update constants from the DWARF 5 public review draft document.

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 08:37:41 PDT 2016


> On Oct 27, 2016, at 8:49 PM, David Blaikie <dblaikie at gmail.com> wrote:
> 
> 
> 
> On Thu, Oct 27, 2016 at 5:13 PM Adrian Prantl <aprantl at apple.com <mailto:aprantl at apple.com>> wrote:
> aprantl created this revision.
> aprantl added reviewers: echristo, dblaikie, probinson.
> aprantl added subscribers: clayborg, llvm-commits.
> Herald added a subscriber: mehdi_amini.
> 
> I noticed two incompatible changes:
> 
> 1. DW_AT_dwo_id was removed because the dwo_id was moved into the CU header. Note that the attribute
> 
> Well, that's a nice change... I should read the spec in more detail. (it would avoid the DWP tool from having to parse any DWARF,

Yes, this would also allow us to verify the dwoid in clang for module debug info (we don't do it because we don't want to parse DWARF in the frontend).

> I think - though it's still nice to parse some to find the dwo_name for better diagnostics, at least we can wait until we've identified a problem before doing that anyway)
>  
> value was reserved, so LLVM can continue to emit it without causing ambiguity for now.
> 
> 1. The one change that could cause a problem here is that DW_AT_ranges_base has been replaced by DW_AT_rnglist_base.
> 
> That's a weird one - how's a DWARF consumer meant to identify whether they're dealing with new or old (whether they should look in debug_ranges or debug_rnglists)? Just based on the version in the header? (is there prior art for that sort of technique?)

The DW_AT_ranges_base attribute was never part of a DWARF standard, AFAIK it was only used in a proposal. For proper DWARF 4 LLVM should probably emit the DW_AT_GNU_ranges_base extension (which, looking at DwarfDebug::finalizeModuleInfo() it does) and for proper DWARF 5 use the standardized format with the new section.
> 
> I suppose in theory our dumper could be smart enough to print the right attribute string depending on version - though that seems annoying... 

Looks like this is not even necessary.

-- adrian

> 
> - David
>  
> 
> David/Eric: Would merely renaming the constant break any existing DWARF (4) tooling?
> 
> 
> https://reviews.llvm.org/D26051 <https://reviews.llvm.org/D26051>
> 
> Files:
>   include/llvm/Support/Dwarf.def
>   include/llvm/Support/Dwarf.h
>   lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp
>   lib/DebugInfo/DWARF/DWARFUnit.cpp
>   lib/Support/Dwarf.cpp
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161028/8958c402/attachment.html>


More information about the llvm-commits mailing list