Skip to content

Commit 4d392cb

Browse files
committed
[lldb] Fix SymbolFile/DWARF/x86/dwp.s
The Swift fork has a call to comp_unit->GetLanguage() which causes the language to be parsed sooner than upstream. Modify the test accordingly and put the downstream change between LLDB_ENABLE_SWIFT ifdefs.
1 parent f99f3f4 commit 4d392cb

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3315,9 +3315,11 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
33153315
}
33163316
}
33173317

3318+
#ifdef LLDB_ENABLE_SWIFT
33183319
if (tag == DW_TAG_variable && mangled &&
33193320
sc.comp_unit->GetLanguage() == eLanguageTypeSwift)
33203321
mangled = nullptr;
3322+
#endif
33213323

33223324
// Prefer DW_AT_location over DW_AT_const_value. Both can be emitted e.g.
33233325
// for static constexpr member variables -- DW_AT_const_value will be

lldb/test/Shell/SymbolFile/DWARF/x86/dwp.s

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,40 @@
1010
# CHECK: (INT3) A = 3
1111

1212
# CHECK-LABEL: image lookup -v -n F1
13-
# CHECK: CompileUnit: id = {0x00000001}, file = "1.c", language = "<not loaded>"
13+
# CHECK: CompileUnit: id = {0x00000001}, file = "1.c", language = "{{<not loaded>|unknown}}"
1414
# CHECK: Function: {{.*}}, name = "F1", range = [0x0000000000000001-0x0000000000000002)
1515
# CHECK: Variable: {{.*}}, name = "x", type = "int", location = DW_OP_reg1 RDX
1616

1717
# SYMBOLS: Compile units:
18-
# SYMBOLS-NEXT: CompileUnit{0x00000000}, language = "<not loaded>", file = '0.c'
18+
# SYMBOLS-NEXT: CompileUnit{0x00000000}, language = "{{<not loaded>|unknown}}", file = '0.c'
1919
# SYMBOLS-NEXT: Variable{{.*}}, name = "A", {{.*}}, location = DW_OP_GNU_addr_index 0x0
2020
# SYMBOLS-NEXT: Function{{.*}}, demangled = F0
2121
# SYMBOLS-NEXT: Block{{.*}}, ranges = [0x00000000-0x00000001)
2222
# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location =
2323
# SYMBOLS-NEXT: DW_LLE_startx_length (0x0000000000000001, 0x0000000000000001): DW_OP_reg0 RAX
2424
# SYMBOLS-EMPTY:
25-
# SYMBOLS-NEXT: CompileUnit{0x00000001}, language = "<not loaded>", file = '1.c'
25+
# SYMBOLS-NEXT: CompileUnit{0x00000001}, language = "{{<not loaded>|unknown}}", file = '1.c'
2626
# SYMBOLS-NEXT: Variable{{.*}}, name = "A", {{.*}}, location = DW_OP_GNU_addr_index 0x2
2727
# SYMBOLS-NEXT: Function{{.*}}, demangled = F1
2828
# SYMBOLS-NEXT: Block{{.*}}, ranges = [0x00000001-0x00000002)
2929
# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location =
3030
# SYMBOLS-NEXT: DW_LLE_startx_length (0x0000000000000003, 0x0000000000000001): DW_OP_reg1 RDX
3131
# SYMBOLS-EMPTY:
32-
# SYMBOLS-NEXT: CompileUnit{0x00000002}, language = "<not loaded>", file = '2.c'
32+
# SYMBOLS-NEXT: CompileUnit{0x00000002}, language = "{{<not loaded>|unknown}}", file = '2.c'
3333
# SYMBOLS-NEXT: Variable{{.*}}, name = "A", {{.*}}, location = DW_OP_GNU_addr_index 0x4
3434
# SYMBOLS-NEXT: Function{{.*}}, demangled = F2
3535
# SYMBOLS-NEXT: Block{{.*}}, ranges = [0x00000002-0x00000003)
3636
# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location =
3737
# SYMBOLS-NEXT: DW_LLE_startx_length (0x0000000000000005, 0x0000000000000001): DW_OP_reg2 RCX
3838
# SYMBOLS-EMPTY:
39-
# SYMBOLS-NEXT: CompileUnit{0x00000003}, language = "<not loaded>", file = '3.c'
39+
# SYMBOLS-NEXT: CompileUnit{0x00000003}, language = "{{<not loaded>|unknown}}", file = '3.c'
4040
# SYMBOLS-NEXT: Variable{{.*}}, name = "A", {{.*}}, location = DW_OP_GNU_addr_index 0x6
4141
# SYMBOLS-NEXT: Function{{.*}}, demangled = F3
4242
# SYMBOLS-NEXT: Block{{.*}}, ranges = [0x00000003-0x00000004)
4343
# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location =
4444
# SYMBOLS-NEXT: DW_LLE_startx_length (0x0000000000000007, 0x0000000000000001): DW_OP_reg3 RBX
4545
# SYMBOLS-EMPTY:
46-
# SYMBOLS-NEXT: CompileUnit{0x00000004}, language = "<not loaded>", file = ''
46+
# SYMBOLS-NEXT: CompileUnit{0x00000004}, language = "{{<not loaded>|unknown}}", file = ''
4747
# SYMBOLS-EMPTY:
4848

4949
.section .debug_abbrev,"",@progbits

0 commit comments

Comments
 (0)