aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-09-19 22:25:17 +0000
committerGreg Clayton <gclayton@apple.com>2012-09-19 22:25:17 +0000
commit9e6cffc9fd3060d94bc4725293a42b02c49abfa5 (patch)
tree04e8e6832c117f6fbcab0fafa3ca0468b6b64a0c /lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
parenta150de05f3067cd872e847314322353ac1902971 (diff)
downloadllvm-9e6cffc9fd3060d94bc4725293a42b02c49abfa5.zip
llvm-9e6cffc9fd3060d94bc4725293a42b02c49abfa5.tar.gz
llvm-9e6cffc9fd3060d94bc4725293a42b02c49abfa5.tar.bz2
A patch that allows for mach-o architectures to be specified as "<number>-<number>" where the first number is the cpu type and the second is the cpu subtype. Also added code to allow use of mach-o architectures that aren't in our tables so that symbolication and static file introspection (crashlogs) can work with them.
llvm-svn: 164258
Diffstat (limited to 'lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp')
-rw-r--r--lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
index 8c263d6..f44465c 100644
--- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
+++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
@@ -432,11 +432,13 @@ bool InstructionLLVMC::s_regex_compiled = false;
Disassembler *
DisassemblerLLVMC::CreateInstance (const ArchSpec &arch)
{
- std::auto_ptr<DisassemblerLLVMC> disasm_ap (new DisassemblerLLVMC(arch));
-
- if (disasm_ap.get() && disasm_ap->IsValid())
- return disasm_ap.release();
+ if (arch.GetTriple().getArch() != llvm::Triple::UnknownArch)
+ {
+ std::auto_ptr<DisassemblerLLVMC> disasm_ap (new DisassemblerLLVMC(arch));
+ if (disasm_ap.get() && disasm_ap->IsValid())
+ return disasm_ap.release();
+ }
return NULL;
}