CmdName + " command");
}
} else if (cputype == MachO::CPU_TYPE_X86_64) {
- if (flavor == MachO::x86_THREAD_STATE64) {
+ if (flavor == MachO::x86_THREAD_STATE) {
+ if (count != MachO::x86_THREAD_STATE_COUNT)
+ return malformedError("load command " + Twine(LoadCommandIndex) +
+ " count not x86_THREAD_STATE_COUNT for "
+ "flavor number " + Twine(nflavor) + " which is "
+ "a x86_THREAD_STATE flavor in " + CmdName +
+ " command");
+ if (state + sizeof(MachO::x86_thread_state_t) > end)
+ return malformedError("load command " + Twine(LoadCommandIndex) +
+ " x86_THREAD_STATE extends past end of "
+ "command in " + CmdName + " command");
+ state += sizeof(MachO::x86_thread_state_t);
+ } else if (flavor == MachO::x86_FLOAT_STATE) {
+ if (count != MachO::x86_FLOAT_STATE_COUNT)
+ return malformedError("load command " + Twine(LoadCommandIndex) +
+ " count not x86_FLOAT_STATE_COUNT for "
+ "flavor number " + Twine(nflavor) + " which is "
+ "a x86_FLOAT_STATE flavor in " + CmdName +
+ " command");
+ if (state + sizeof(MachO::x86_float_state_t) > end)
+ return malformedError("load command " + Twine(LoadCommandIndex) +
+ " x86_FLOAT_STATE extends past end of "
+ "command in " + CmdName + " command");
+ state += sizeof(MachO::x86_float_state_t);
+ } else if (flavor == MachO::x86_EXCEPTION_STATE) {
+ if (count != MachO::x86_EXCEPTION_STATE_COUNT)
+ return malformedError("load command " + Twine(LoadCommandIndex) +
+ " count not x86_EXCEPTION_STATE_COUNT for "
+ "flavor number " + Twine(nflavor) + " which is "
+ "a x86_EXCEPTION_STATE flavor in " + CmdName +
+ " command");
+ if (state + sizeof(MachO::x86_exception_state_t) > end)
+ return malformedError("load command " + Twine(LoadCommandIndex) +
+ " x86_EXCEPTION_STATE extends past end of "
+ "command in " + CmdName + " command");
+ state += sizeof(MachO::x86_exception_state_t);
+ } else if (flavor == MachO::x86_THREAD_STATE64) {
if (count != MachO::x86_THREAD_STATE64_COUNT)
return malformedError("load command " + Twine(LoadCommandIndex) +
" count not x86_THREAD_STATE64_COUNT for "
" x86_THREAD_STATE64 extends past end of "
"command in " + CmdName + " command");
state += sizeof(MachO::x86_thread_state64_t);
+ } else if (flavor == MachO::x86_EXCEPTION_STATE64) {
+ if (count != MachO::x86_EXCEPTION_STATE64_COUNT)
+ return malformedError("load command " + Twine(LoadCommandIndex) +
+ " count not x86_EXCEPTION_STATE64_COUNT for "
+ "flavor number " + Twine(nflavor) + " which is "
+ "a x86_EXCEPTION_STATE64 flavor in " + CmdName +
+ " command");
+ if (state + sizeof(MachO::x86_exception_state64_t) > end)
+ return malformedError("load command " + Twine(LoadCommandIndex) +
+ " x86_EXCEPTION_STATE64 extends past end of "
+ "command in " + CmdName + " command");
+ state += sizeof(MachO::x86_exception_state64_t);
} else {
return malformedError("load command " + Twine(LoadCommandIndex) +
" unknown flavor (" + Twine(flavor) + ") for "
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";