aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2015-02-17 18:33:17 +0000
committerEd Maste <emaste@FreeBSD.org>2015-02-17 18:33:17 +0000
commitb153f37ffcefa028161d80c3852223dea7c93f4c (patch)
tree065db9f0d8a2ea1ff533f060977be2245e068962 /contrib/llvm
parent1d4a49a324d6243fc4a2bddd5a19efa01e6c4b86 (diff)
downloadsrc-b153f37ffcefa028161d80c3852223dea7c93f4c.tar.gz
src-b153f37ffcefa028161d80c3852223dea7c93f4c.zip
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.
Notes
Notes: svn path=/head/; revision=278909
Diffstat (limited to 'contrib/llvm')
-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 d86aee78947f..1e703281b2c6 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));