From cfee963282b6bd20ff80e8c2ef8314c4667f052e Mon Sep 17 00:00:00 2001 From: Todd Fiala Date: Wed, 16 Jul 2014 15:03:10 +0000 Subject: Add kalimba as a platform. This change comprises of additions and some minor changes in order that "kalimba" is listed as a supported platform and that debugging any kalimbas results in PlatformKalimba being associated with the target. The changes are as follows: * The PlatformKalimba implementation itself * A tweak to ArchSpec * .note parsing for Kalimba in ObjectFileELF.cpp * Plugin registration * Makefile additions Change by Matthew Gardiner Minor tweak for cmake and Xcode by Todd Fiala Tested: Ubuntu 14.04 x86_64, clang 3.5-built lldb, all tests pass. MacOSX 10.9.4, Xcode 6.0 Beta 1-built lldb, all tests pass. llvm-svn: 213158 --- lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp') diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 50cdd18a8fb..bd819c44930 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -46,6 +46,7 @@ namespace { const char *const LLDB_NT_OWNER_FREEBSD = "FreeBSD"; const char *const LLDB_NT_OWNER_GNU = "GNU"; const char *const LLDB_NT_OWNER_NETBSD = "NetBSD"; +const char *const LLDB_NT_OWNER_CSR = "csr"; // ELF note type definitions const elf_word LLDB_NT_FREEBSD_ABI_TAG = 0x01; @@ -1221,6 +1222,24 @@ ObjectFileELF::RefineModuleDetailsFromNote (lldb_private::DataExtractor &data, l if (log) log->Printf ("ObjectFileELF::%s detected NetBSD, min version constant %" PRIu32, __FUNCTION__, version_info); } + // Process CSR kalimba notes + else if ((note.n_type == LLDB_NT_GNU_ABI_TAG) && + (note.n_name == LLDB_NT_OWNER_CSR)) + { + // We'll consume the payload below. + processed = true; + arch_spec.GetTriple().setOS(llvm::Triple::OSType::UnknownOS); + arch_spec.GetTriple().setVendor(llvm::Triple::VendorType::CSR); + + // TODO At some point the description string could be processed. + // It could provide a steer towards the kalimba variant which + // this ELF targets. + if(note.n_descsz) + { + const char *cstr = data.GetCStr(&offset, llvm::RoundUpToAlignment (note.n_descsz, 4)); + (void)cstr; + } + } if (!processed) offset += llvm::RoundUpToAlignment(note.n_descsz, 4); -- cgit v1.2.3