[PATCH] D25822: [DWARF parsers] - Add a way to get section indexes when call DWARFUnit::collectAddressRanges()

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 20 05:03:21 PDT 2016


grimar created this revision.
grimar added reviewers: rafael, aprantl, dblaikie, echristo.
grimar added subscribers: llvm-commits, grimar, evgeny777, davide, ruiu.
Herald added a subscriber: mehdi_amini.

For LLD --gdb-index patch (https://reviews.llvm.org/D25821) I need to write the address area. The address area is a sequence of address
entries, where each entrie contains low address, high address and CU index.

I can get this info (using DWARFUnit::collectAddressRanges()) 
from DW_AT_low_pc/DW_AT_high_pc attribute which are relocated addresses.
Problem is that there is no way to get section index these addresses refer to. At the moment of building
index I do not yet know the final input sections offsets and output section VA's, so I think
I need to store section index to use it later (that is how above patch do).

Patch do next things:

- We have RelocAddrMap, which is map of pairs [relocation width, relocation value]

and was declared both in DWARFContext.h and DWARFRelocMap.h. I leaved declaration only in DWARFRelocMap.h.
At fact first element of pair was never used in code. So I replaced it with section index.

- I modified content of DWARFAddressRangesVector to keep section index as well, so now it is possible to get

it via DWARFUnit::collectAddressRanges() call.


https://reviews.llvm.org/D25822

Files:
  include/llvm/DebugInfo/DWARF/DWARFContext.h
  include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h
  include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h
  include/llvm/DebugInfo/DWARF/DWARFFormValue.h
  include/llvm/DebugInfo/DWARF/DWARFRelocMap.h
  include/llvm/Object/COFF.h
  include/llvm/Object/ELFObjectFile.h
  include/llvm/Object/MachO.h
  include/llvm/Object/ObjectFile.h
  lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
  lib/DebugInfo/DWARF/DWARFContext.cpp
  lib/DebugInfo/DWARF/DWARFDebugAranges.cpp
  lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp
  lib/DebugInfo/DWARF/DWARFDebugLine.cpp
  lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
  lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp
  lib/DebugInfo/DWARF/DWARFFormValue.cpp
  lib/Object/COFFObjectFile.cpp
  lib/Object/MachOObjectFile.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25822.75287.patch
Type: text/x-patch
Size: 18005 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161020/939ff069/attachment.bin>


More information about the llvm-commits mailing list