]> granicus.if.org Git - llvm/commit
dwarfgen: Add support for generating the debug_str_offsets section
authorPavel Labath <labath@google.com>
Wed, 25 Jul 2018 11:55:59 +0000 (11:55 +0000)
committerPavel Labath <labath@google.com>
Wed, 25 Jul 2018 11:55:59 +0000 (11:55 +0000)
commitb1674d0d93b9fb1119c1c0c6af9631e95542d68f
tree826db0c20dc8afa521cc05cbe570ceb967184ca2
parentf5b8d1cf394126cb73b4d6aedb52469c9e72c4b5
dwarfgen: Add support for generating the debug_str_offsets section

Summary:
The motivation for this is D49493, where we'd like to test details of
debug_str_offsets behavior which is difficult to trigger from a
traditional test.

This adds the plubming necessary for dwarfgen to generate this section.
The more interesting changes are:
- I've moved emitStringOffsetsTableHeader function from DwarfFile to
  DwarfStringPool, so I can generate the section header more easily from
  the unit test.
- added a new addAttribute overload taking an MCExpr*. This is used to
  generate the DW_AT_str_offsets_base, which links a compile unit to the
  offset table.

I've also added a basic test for reading and writing DW_form_strx forms.

Reviewers: dblaikie, JDevlieghere, probinson

Subscribers: llvm-commits, aprantl

Differential Revision: https://reviews.llvm.org/D49670

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337910 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfFile.cpp
lib/CodeGen/AsmPrinter/DwarfFile.h
lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
lib/CodeGen/AsmPrinter/DwarfStringPool.h
unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
unittests/DebugInfo/DWARF/DwarfGenerator.cpp
unittests/DebugInfo/DWARF/DwarfGenerator.h