diff options
author | Greg Clayton <gclayton@apple.com> | 2010-06-11 03:25:34 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-06-11 03:25:34 +0000 |
commit | 41f923275eb15ac0b2fc9442f272fd6e4ed8f12a (patch) | |
tree | 51ee99af424e6a63af024889f2550151c3d5957e /lldb/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp | |
parent | 9af2d4a6141c4bad8a9e53912469b5ff13079464 (diff) | |
download | bcm5719-llvm-41f923275eb15ac0b2fc9442f272fd6e4ed8f12a.tar.gz bcm5719-llvm-41f923275eb15ac0b2fc9442f272fd6e4ed8f12a.zip |
Made lldb_private::ArchSpec more generic so that it can take a mach-o cpu
type and sub-type, or an ELF e_machine value. Also added a generic CPU type
to the arch spec class so we can have a single arch definition that the LLDB
core code can use. Previously a lot of places in the code were using the
mach-o definitions from a macosx header file.
Switches over to using "llvm/Support/MachO.h" for the llvm::MachO::XXX for the
CPU types and sub types for mach-o ArchSpecs. Added "llvm/Support/ELF.h" so
we can use the "llvm::ELF::XXX" defines for the ELF ArchSpecs.
Got rid of all CPU_TYPE_ and CPU_SUBTYPE_ defines that were previously being
used in LLDB.
llvm-svn: 105806
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp b/lldb/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp index 58a7ac043c5..e6c7b354abc 100644 --- a/lldb/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp +++ b/lldb/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp @@ -250,15 +250,16 @@ instruction_length (lldb_private::unw_addr_space_t as, lldb_private::unw_word_t if (arg == 0) return -1; - Thread *th = (Thread *) arg; - const ArchSpec target_arch (th->GetProcess().GetTarget().GetArchitecture ()); + Thread *thread = (Thread *) arg; - if (target_arch.GetCPUType() == CPU_TYPE_I386) + const ArchSpec::CPU arch_cpu = thread->GetProcess().GetTarget().GetArchitecture ().GetGenericCPUType(); + + if (arch_cpu == ArchSpec::eCPU_i386) { if (EDGetDisassembler (&disasm, "i386-apple-darwin", kEDAssemblySyntaxX86ATT) != 0) return -1; } - else if (target_arch.GetCPUType() == CPU_TYPE_X86_64) + else if (arch_cpu == ArchSpec::eCPU_x86_64) { if (EDGetDisassembler (&disasm, "x86_64-apple-darwin", kEDAssemblySyntaxX86ATT) != 0) return -1; |