summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-02-17 18:33:17 +0000
committeremaste <emaste@FreeBSD.org>2015-02-17 18:33:17 +0000
commitcee0ede2f203b96296d38ec04d3e1e4d0fa54404 (patch)
tree065db9f0d8a2ea1ff533f060977be2245e068962 /contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
parent458f969535c860ee253941929e0f8b9f42ba19be (diff)
downloadFreeBSD-src-cee0ede2f203b96296d38ec04d3e1e4d0fa54404.zip
FreeBSD-src-cee0ede2f203b96296d38ec04d3e1e4d0fa54404.tar.gz
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.
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp5
1 files changed, 4 insertions, 1 deletions
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 &section_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));
OpenPOWER on IntegriCloud