diff options
author | Kevin Enderby <enderby@apple.com> | 2018-03-08 23:10:38 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2018-03-08 23:10:38 +0000 |
commit | 299cd890fedbcbc5302d8237bf58597794ebde72 (patch) | |
tree | b7b286265726b9d3a038a2acc759755bf124e4af /llvm/tools/llvm-objdump | |
parent | f96b1b88f804054d21d0a820388307766c48d453 (diff) | |
download | bcm5719-llvm-299cd890fedbcbc5302d8237bf58597794ebde72.tar.gz bcm5719-llvm-299cd890fedbcbc5302d8237bf58597794ebde72.zip |
For llvm-objdump and Mach-O files, update the printing of some thread states
from core files. I tested this against the couple of core files that were
getting errors about unknown thread flavors and it now produce the same output as
the Xcode otool-classic(1) tool. Since the core files are huge I didn’t include
them as test cases.
rdar://38216356
llvm-svn: 327077
Diffstat (limited to 'llvm/tools/llvm-objdump')
-rw-r--r-- | llvm/tools/llvm-objdump/MachODump.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index b6c26ac9869..c5aba86b20e 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -9328,6 +9328,26 @@ static void PrintThreadCommand(MachO::thread_command t, const char *Ptr, outs() << "\t esh.flavor " << es.esh.flavor << " esh.count " << es.esh.count << "\n"; } + } else if (flavor == MachO::x86_EXCEPTION_STATE64) { + outs() << " flavor x86_EXCEPTION_STATE64\n"; + if (count == MachO::x86_EXCEPTION_STATE64_COUNT) + outs() << " count x86_EXCEPTION_STATE64_COUNT\n"; + else + outs() << " count " << count + << " (not x86_EXCEPTION_STATE64_COUNT)\n"; + struct MachO::x86_exception_state64_t es64; + left = end - begin; + if (left >= sizeof(MachO::x86_exception_state64_t)) { + memcpy(&es64, begin, sizeof(MachO::x86_exception_state64_t)); + begin += sizeof(MachO::x86_exception_state64_t); + } else { + memset(&es64, '\0', sizeof(MachO::x86_exception_state64_t)); + memcpy(&es64, begin, left); + begin += left; + } + if (isLittleEndian != sys::IsLittleEndianHost) + swapStruct(es64); + Print_x86_exception_state_t(es64); } else { outs() << " flavor " << flavor << " (unknown)\n"; outs() << " count " << count << "\n"; |