This implements the support for .debug_loclists section, which is
DWARF 5 version of .debug_loc.
Currently, clang is able to emit it with the use of D53365.
Paths
| Differential D53436
[LLDB] - Implement the support for the .debug_loclists section. ClosedPublic Authored by grimar on Oct 19 2018, 7:31 AM.
Details
Summary This implements the support for .debug_loclists section, which is Currently, clang is able to emit it with the use of D53365.
Diff Detail Event TimelineComment Actions Since .debug_loclists contains locations descriptions for objects At the same time I was able to test it with the following code and invocation: ~/LLVM/build/bin/clang -gdwarf-5 test.cc -o test_v5-fuse-ld=lld -fno-rtti struct A { int x = 0; virtual void foo(); }; void baz(struct A a) { a.foo(); } void A::foo() { int x = 0; ++x; } int main() { A objA; objA.x = 3; baz(objA); return 0; } After executing the following commands, the location of a is properly evaluated: (lldb) target create "test_v5" Current executable set to 'test_v5' (x86_64). (lldb) b baz Breakpoint 1: where = test_v5`baz(A) + 4 at test.cc:9:6, address = 0x00000000002010e4 (lldb) run Process 115974 launched: '/home/umb/tests_2018/110_lldbloclists/test_v5' (x86_64) Process 115974 stopped * thread #1, name = 'test_v5', stop reason = breakpoint 1.1 frame #0: 0x00000000002010e4 test_v5`baz(a=(x = 3)) at test.cc:9:6 6 }; 7 8 void baz(struct A a) { -> 9 a.foo(); 10 } Without this patch output will be: ... frame #0: 0x00000000002010e4 test_v5`baz(a=<unavailable>) at test.cc:9:6 ... Comment Actions Just fix the assert to use lldbassert so we don't crash as mentioned in the inline comment and this is good to go.
This revision is now accepted and ready to land.Oct 22 2018, 12:49 PM Closed by commit rLLDB345016: [LLDB] - Implement the support for the .debug_loclists section. (authored by grimar). · Explain WhyOct 23 2018, 2:48 AM Closed by commit rL345016: [LLDB] - Implement the support for the .debug_loclists section. (authored by grimar). · Explain Why This revision was automatically updated to reflect the committed changes. This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 170468 include/lldb/Expression/DWARFExpression.h
include/lldb/lldb-enumerations.h
source/Core/Section.cpp
source/Expression/DWARFExpression.cpp
source/Expression/IRExecutionUnit.cpp
source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp
source/Symbol/ObjectFile.cpp
|
use lldbassert so this doesn't crash a release debugger.