[Lldb-commits] [PATCH] D152872: Add support for __debug_line_str in Mach-O
This revision was automatically updated to reflect the committed changes. Closed by commit rG27fac4a72ae5: Add support for __debug_line_str in Mach-O (authored by aprantl). Herald added a project: LLDB. Herald added a subscriber: lldb-commits. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152872/new/ https://reviews.llvm.org/D152872 Files: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp lldb/test/Shell/SymbolFile/DWARF/x86/dwarf5-macho.c Index: lldb/test/Shell/SymbolFile/DWARF/x86/dwarf5-macho.c === --- /dev/null +++ lldb/test/Shell/SymbolFile/DWARF/x86/dwarf5-macho.c @@ -0,0 +1,15 @@ +// Test that the file names in the __debug_line_str section can be decoded. + +// REQUIRES: system-darwin + +// RUN: %clang -target x86_64-apple-darwin %s -c -o %t.o -gdwarf-5 +// RUN: llvm-readobj --sections %t.o | FileCheck %s --check-prefix NAMES +// RUN: xcrun %clang -target x86_64-apple-darwin -o %t.exe %t.o +// RUN: %lldb %t.exe -b -o "target modules dump line-table %s" | FileCheck %s + +// NAMES: Name: __debug_line_str + +int main(int argc, char **argv) { + // CHECK: dwarf5-macho.c:[[@LINE+1]] + return 0; +} Index: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp === --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1443,6 +1443,7 @@ static ConstString g_sect_name_dwarf_debug_frame("__debug_frame"); static ConstString g_sect_name_dwarf_debug_info("__debug_info"); static ConstString g_sect_name_dwarf_debug_line("__debug_line"); + static ConstString g_sect_name_dwarf_debug_line_str("__debug_line_str"); static ConstString g_sect_name_dwarf_debug_loc("__debug_loc"); static ConstString g_sect_name_dwarf_debug_loclists("__debug_loclists"); static ConstString g_sect_name_dwarf_debug_macinfo("__debug_macinfo"); @@ -1472,6 +1473,8 @@ return eSectionTypeDWARFDebugInfo; if (section_name == g_sect_name_dwarf_debug_line) return eSectionTypeDWARFDebugLine; + if (section_name == g_sect_name_dwarf_debug_line_str) +return eSectionTypeDWARFDebugLineStr; if (section_name == g_sect_name_dwarf_debug_loc) return eSectionTypeDWARFDebugLoc; if (section_name == g_sect_name_dwarf_debug_loclists) Index: lldb/test/Shell/SymbolFile/DWARF/x86/dwarf5-macho.c === --- /dev/null +++ lldb/test/Shell/SymbolFile/DWARF/x86/dwarf5-macho.c @@ -0,0 +1,15 @@ +// Test that the file names in the __debug_line_str section can be decoded. + +// REQUIRES: system-darwin + +// RUN: %clang -target x86_64-apple-darwin %s -c -o %t.o -gdwarf-5 +// RUN: llvm-readobj --sections %t.o | FileCheck %s --check-prefix NAMES +// RUN: xcrun %clang -target x86_64-apple-darwin -o %t.exe %t.o +// RUN: %lldb %t.exe -b -o "target modules dump line-table %s" | FileCheck %s + +// NAMES: Name: __debug_line_str + +int main(int argc, char **argv) { + // CHECK: dwarf5-macho.c:[[@LINE+1]] + return 0; +} Index: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp === --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1443,6 +1443,7 @@ static ConstString g_sect_name_dwarf_debug_frame("__debug_frame"); static ConstString g_sect_name_dwarf_debug_info("__debug_info"); static ConstString g_sect_name_dwarf_debug_line("__debug_line"); + static ConstString g_sect_name_dwarf_debug_line_str("__debug_line_str"); static ConstString g_sect_name_dwarf_debug_loc("__debug_loc"); static ConstString g_sect_name_dwarf_debug_loclists("__debug_loclists"); static ConstString g_sect_name_dwarf_debug_macinfo("__debug_macinfo"); @@ -1472,6 +1473,8 @@ return eSectionTypeDWARFDebugInfo; if (section_name == g_sect_name_dwarf_debug_line) return eSectionTypeDWARFDebugLine; + if (section_name == g_sect_name_dwarf_debug_line_str) +return eSectionTypeDWARFDebugLineStr; if (section_name == g_sect_name_dwarf_debug_loc) return eSectionTypeDWARFDebugLoc; if (section_name == g_sect_name_dwarf_debug_loclists) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D152872: Add support for __debug_line_str in Mach-O
fdeazeve accepted this revision. fdeazeve added a comment. Nice and subtle fix! :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152872/new/ https://reviews.llvm.org/D152872 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D152872: Add support for __debug_line_str in Mach-O
JDevlieghere accepted this revision. JDevlieghere added a comment. This revision is now accepted and ready to land. LGTM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152872/new/ https://reviews.llvm.org/D152872 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D152872: Add support for __debug_line_str in Mach-O
aprantl created this revision. aprantl added reviewers: bulbazord, fdeazeve, rastogishubham, JDevlieghere. Herald added a project: All. aprantl requested review of this revision. This patch resolves an issue that currently accounts for the vast majority of failures on the matrix bot. https://reviews.llvm.org/D152872 Files: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp lldb/test/Shell/SymbolFile/DWARF/x86/dwarf5-macho.c Index: lldb/test/Shell/SymbolFile/DWARF/x86/dwarf5-macho.c === --- /dev/null +++ lldb/test/Shell/SymbolFile/DWARF/x86/dwarf5-macho.c @@ -0,0 +1,15 @@ +// Test that the file names in the __debug_line_str section can be decoded. + +// REQUIRES: system-darwin + +// RUN: %clang -target x86_64-apple-darwin %s -c -o %t.o -gdwarf-5 +// RUN: llvm-readobj --sections %t.o | FileCheck %s --check-prefix NAMES +// RUN: xcrun %clang -target x86_64-apple-darwin -o %t.exe %t.o +// RUN: %lldb %t.exe -b -o "target modules dump line-table %s" | FileCheck %s + +// NAMES: Name: __debug_line_str + +int main(int argc, char **argv) { + // CHECK: dwarf5-macho.c:[[@LINE+1]] + return 0; +} Index: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp === --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1443,6 +1443,7 @@ static ConstString g_sect_name_dwarf_debug_frame("__debug_frame"); static ConstString g_sect_name_dwarf_debug_info("__debug_info"); static ConstString g_sect_name_dwarf_debug_line("__debug_line"); + static ConstString g_sect_name_dwarf_debug_line_str("__debug_line_str"); static ConstString g_sect_name_dwarf_debug_loc("__debug_loc"); static ConstString g_sect_name_dwarf_debug_loclists("__debug_loclists"); static ConstString g_sect_name_dwarf_debug_macinfo("__debug_macinfo"); @@ -1472,6 +1473,8 @@ return eSectionTypeDWARFDebugInfo; if (section_name == g_sect_name_dwarf_debug_line) return eSectionTypeDWARFDebugLine; + if (section_name == g_sect_name_dwarf_debug_line_str) +return eSectionTypeDWARFDebugLineStr; if (section_name == g_sect_name_dwarf_debug_loc) return eSectionTypeDWARFDebugLoc; if (section_name == g_sect_name_dwarf_debug_loclists) Index: lldb/test/Shell/SymbolFile/DWARF/x86/dwarf5-macho.c === --- /dev/null +++ lldb/test/Shell/SymbolFile/DWARF/x86/dwarf5-macho.c @@ -0,0 +1,15 @@ +// Test that the file names in the __debug_line_str section can be decoded. + +// REQUIRES: system-darwin + +// RUN: %clang -target x86_64-apple-darwin %s -c -o %t.o -gdwarf-5 +// RUN: llvm-readobj --sections %t.o | FileCheck %s --check-prefix NAMES +// RUN: xcrun %clang -target x86_64-apple-darwin -o %t.exe %t.o +// RUN: %lldb %t.exe -b -o "target modules dump line-table %s" | FileCheck %s + +// NAMES: Name: __debug_line_str + +int main(int argc, char **argv) { + // CHECK: dwarf5-macho.c:[[@LINE+1]] + return 0; +} Index: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp === --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1443,6 +1443,7 @@ static ConstString g_sect_name_dwarf_debug_frame("__debug_frame"); static ConstString g_sect_name_dwarf_debug_info("__debug_info"); static ConstString g_sect_name_dwarf_debug_line("__debug_line"); + static ConstString g_sect_name_dwarf_debug_line_str("__debug_line_str"); static ConstString g_sect_name_dwarf_debug_loc("__debug_loc"); static ConstString g_sect_name_dwarf_debug_loclists("__debug_loclists"); static ConstString g_sect_name_dwarf_debug_macinfo("__debug_macinfo"); @@ -1472,6 +1473,8 @@ return eSectionTypeDWARFDebugInfo; if (section_name == g_sect_name_dwarf_debug_line) return eSectionTypeDWARFDebugLine; + if (section_name == g_sect_name_dwarf_debug_line_str) +return eSectionTypeDWARFDebugLineStr; if (section_name == g_sect_name_dwarf_debug_loc) return eSectionTypeDWARFDebugLoc; if (section_name == g_sect_name_dwarf_debug_loclists) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits