llvm-project/llvm/lib/DebugInfo
Jonas Devlieghere 4cc567bb9e [DWARFFormValue] Don't consider DW_FORM_data4/8 to be section offsets.
When dumping ToT clan's debug info with dwarfdump, we were seeing an
error saying that that the location list overflows the debug_loc
section. After reducing the testcase we figured out that we were
interpreting the DW_FORM_data4 as a section offset.

In DWARF3 DW_FORM_data4 and DW_FORM_data8 served also as a section
offset. Until now we didn't check check for the DWARF version, because
some producers (read old versions of clang) were still emitting this.
The relevant code/comment was added in 2013, and I believe it's now
reasonable to start checking the version.

The FormValue class is a little bit of a mess because it cashes the
DWARF unit and context when it extracted the value itself. Several
methods of the class rely on it being present, or return an Optional for
the code path that needs it. At the same time the FormValue class also
used in places where there's no DWARF unit.

For this patch I went with the least invasive change: checking the
version from the CU when it's available. If it's not (because the form
value was created from a value directly) we default to the old behavior.

Differential revision: https://reviews.llvm.org/D58698

llvm-svn: 355456
2019-03-05 23:47:22 +00:00
..
CodeView Move some classes into anonymous namespaces. NFC. 2019-02-11 15:16:21 +00:00
DWARF [DWARFFormValue] Don't consider DW_FORM_data4/8 to be section offsets. 2019-03-05 23:47:22 +00:00
MSF Move some classes into anonymous namespaces. NFC. 2019-02-11 15:16:21 +00:00
PDB [DebugInfo] add SectionedAddress to DebugInfo interfaces. 2019-02-27 13:17:36 +00:00
Symbolize [DebugInfo] add SectionedAddress to DebugInfo interfaces. 2019-02-27 13:17:36 +00:00
CMakeLists.txt
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00