Skip to content

[lldb] Fix SymbolFile/DWARF/x86/dwp.s #3749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3315,9 +3315,11 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
}
}

#ifdef LLDB_ENABLE_SWIFT
if (tag == DW_TAG_variable && mangled &&
sc.comp_unit->GetLanguage() == eLanguageTypeSwift)
mangled = nullptr;
#endif

// Prefer DW_AT_location over DW_AT_const_value. Both can be emitted e.g.
// for static constexpr member variables -- DW_AT_const_value will be
Expand Down
12 changes: 6 additions & 6 deletions lldb/test/Shell/SymbolFile/DWARF/x86/dwp.s
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,40 @@
# CHECK: (INT3) A = 3

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

# SYMBOLS: Compile units:
# SYMBOLS-NEXT: CompileUnit{0x00000000}, language = "<not loaded>", file = '0.c'
# SYMBOLS-NEXT: CompileUnit{0x00000000}, language = "{{<not loaded>|unknown}}", file = '0.c'
# SYMBOLS-NEXT: Variable{{.*}}, name = "A", {{.*}}, location = DW_OP_GNU_addr_index 0x0
# SYMBOLS-NEXT: Function{{.*}}, demangled = F0
# SYMBOLS-NEXT: Block{{.*}}, ranges = [0x00000000-0x00000001)
# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location =
# SYMBOLS-NEXT: DW_LLE_startx_length (0x0000000000000001, 0x0000000000000001): DW_OP_reg0 RAX
# SYMBOLS-EMPTY:
# SYMBOLS-NEXT: CompileUnit{0x00000001}, language = "<not loaded>", file = '1.c'
# SYMBOLS-NEXT: CompileUnit{0x00000001}, language = "{{<not loaded>|unknown}}", file = '1.c'
# SYMBOLS-NEXT: Variable{{.*}}, name = "A", {{.*}}, location = DW_OP_GNU_addr_index 0x2
# SYMBOLS-NEXT: Function{{.*}}, demangled = F1
# SYMBOLS-NEXT: Block{{.*}}, ranges = [0x00000001-0x00000002)
# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location =
# SYMBOLS-NEXT: DW_LLE_startx_length (0x0000000000000003, 0x0000000000000001): DW_OP_reg1 RDX
# SYMBOLS-EMPTY:
# SYMBOLS-NEXT: CompileUnit{0x00000002}, language = "<not loaded>", file = '2.c'
# SYMBOLS-NEXT: CompileUnit{0x00000002}, language = "{{<not loaded>|unknown}}", file = '2.c'
# SYMBOLS-NEXT: Variable{{.*}}, name = "A", {{.*}}, location = DW_OP_GNU_addr_index 0x4
# SYMBOLS-NEXT: Function{{.*}}, demangled = F2
# SYMBOLS-NEXT: Block{{.*}}, ranges = [0x00000002-0x00000003)
# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location =
# SYMBOLS-NEXT: DW_LLE_startx_length (0x0000000000000005, 0x0000000000000001): DW_OP_reg2 RCX
# SYMBOLS-EMPTY:
# SYMBOLS-NEXT: CompileUnit{0x00000003}, language = "<not loaded>", file = '3.c'
# SYMBOLS-NEXT: CompileUnit{0x00000003}, language = "{{<not loaded>|unknown}}", file = '3.c'
# SYMBOLS-NEXT: Variable{{.*}}, name = "A", {{.*}}, location = DW_OP_GNU_addr_index 0x6
# SYMBOLS-NEXT: Function{{.*}}, demangled = F3
# SYMBOLS-NEXT: Block{{.*}}, ranges = [0x00000003-0x00000004)
# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location =
# SYMBOLS-NEXT: DW_LLE_startx_length (0x0000000000000007, 0x0000000000000001): DW_OP_reg3 RBX
# SYMBOLS-EMPTY:
# SYMBOLS-NEXT: CompileUnit{0x00000004}, language = "<not loaded>", file = ''
# SYMBOLS-NEXT: CompileUnit{0x00000004}, language = "{{<not loaded>|unknown}}", file = ''
# SYMBOLS-EMPTY:

.section .debug_abbrev,"",@progbits
Expand Down