From cee0ede2f203b96296d38ec04d3e1e4d0fa54404 Mon Sep 17 00:00:00 2001 From: emaste Date: Tue, 17 Feb 2015 18:33:17 +0000 Subject: lldb: workaround to permit cross-arch core file debugging FreeBSD core files have no section table and thus LLDB's OS and vendor detection logic does not work. If we encounter such an ELF file, update an unknown OS to match the host. This is not really the correct way to handle this, but more extensive rework of ObjectFileELF will be needed and this change restores cross- arch core debugging until that can be completed. --- .../llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp') diff --git a/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index d86aee7..1e70328 100644 --- a/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1331,8 +1331,11 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers, } // If there are no section headers we are done. - if (header.e_shnum == 0) + if (header.e_shnum == 0) { + if (arch_spec.GetTriple().getOS() == llvm::Triple::OSType::UnknownOS) + arch_spec.GetTriple().setOSName(HostInfo::GetOSString().data()); return 0; + } Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_MODULES)); -- cgit v1.1