dblaikie updated this revision to Diff 315036.
dblaikie added a comment.
Use image lookup to make test runnable without executing the test code
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94064/new/
https://reviews.llvm.org/D94064
Files:
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/test/Shell/SymbolFile/DWARF/subprogram_ranges.test
Index: lldb/test/Shell/SymbolFile/DWARF/subprogram_ranges.test
===================================================================
--- lldb/test/Shell/SymbolFile/DWARF/subprogram_ranges.test
+++ lldb/test/Shell/SymbolFile/DWARF/subprogram_ranges.test
@@ -15,3 +15,7 @@
b main
# CHECK: (lldb) b main
# CHECK-NEXT: Breakpoint 1: where = subprogram_ranges.test.tmp.out`main + 6 at
main.c:2:7
+
+image lookup -v -s main
+# CHECK: 1 symbols match 'main'
+# CHECK: Variable: {{.*}}, name = "var", type = "int", {{.*}}, decl = main.c:2
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -3040,8 +3040,13 @@
if (sc.function) {
DWARFDIE function_die = GetDIE(sc.function->GetID());
- const dw_addr_t func_lo_pc = function_die.GetAttributeValueAsAddress(
+ dw_addr_t func_lo_pc = function_die.GetAttributeValueAsAddress(
DW_AT_low_pc, LLDB_INVALID_ADDRESS);
+ DWARFFormValue form_value;
+ if (func_lo_pc == LLDB_INVALID_ADDRESS &&
+ function_die.GetDIE()->GetAttributeValue(function_die.GetCU(),
+ DW_AT_ranges, form_value))
+ func_lo_pc = 0;
if (func_lo_pc != LLDB_INVALID_ADDRESS) {
const size_t num_variables = ParseVariables(
sc, function_die.GetFirstChild(), func_lo_pc, true, true);
Index: lldb/test/Shell/SymbolFile/DWARF/subprogram_ranges.test
===================================================================
--- lldb/test/Shell/SymbolFile/DWARF/subprogram_ranges.test
+++ lldb/test/Shell/SymbolFile/DWARF/subprogram_ranges.test
@@ -15,3 +15,7 @@
b main
# CHECK: (lldb) b main
# CHECK-NEXT: Breakpoint 1: where = subprogram_ranges.test.tmp.out`main + 6 at main.c:2:7
+
+image lookup -v -s main
+# CHECK: 1 symbols match 'main'
+# CHECK: Variable: {{.*}}, name = "var", type = "int", {{.*}}, decl = main.c:2
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -3040,8 +3040,13 @@
if (sc.function) {
DWARFDIE function_die = GetDIE(sc.function->GetID());
- const dw_addr_t func_lo_pc = function_die.GetAttributeValueAsAddress(
+ dw_addr_t func_lo_pc = function_die.GetAttributeValueAsAddress(
DW_AT_low_pc, LLDB_INVALID_ADDRESS);
+ DWARFFormValue form_value;
+ if (func_lo_pc == LLDB_INVALID_ADDRESS &&
+ function_die.GetDIE()->GetAttributeValue(function_die.GetCU(),
+ DW_AT_ranges, form_value))
+ func_lo_pc = 0;
if (func_lo_pc != LLDB_INVALID_ADDRESS) {
const size_t num_variables = ParseVariables(
sc, function_die.GetFirstChild(), func_lo_pc, true, true);
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits