diff options
| author | Greg Clayton <gclayton@apple.com> | 2011-07-20 01:32:50 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2011-07-20 01:32:50 +0000 |
| commit | 0c54d8a97c2228fdc1b675b772a7fa78a080e08e (patch) | |
| tree | 441b92cd4719b16127512d47d2fbad84cefee2ba /lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.cpp | |
| parent | 270e014b7a7c343300b1798b6959e61f712a0cba (diff) | |
| download | bcm5719-llvm-0c54d8a97c2228fdc1b675b772a7fa78a080e08e.tar.gz bcm5719-llvm-0c54d8a97c2228fdc1b675b772a7fa78a080e08e.zip | |
Added register reading support for ARM, i386 and x86_64.
llvm-svn: 135557
Diffstat (limited to 'lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.cpp | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.cpp index 7b7fc0f5fee..503ce75181c 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.cpp @@ -9,19 +9,20 @@ // C Includes -#include <mach/thread_act.h> - // C++ Includes // Other libraries and framework includes // Project includes #include "RegisterContextKDP_i386.h" +#include "ProcessKDP.h" +#include "ThreadKDP.h" using namespace lldb; using namespace lldb_private; -RegisterContextKDP_i386::RegisterContextKDP_i386(Thread &thread, uint32_t concrete_frame_idx) : - RegisterContextDarwin_i386 (thread, concrete_frame_idx) +RegisterContextKDP_i386::RegisterContextKDP_i386 (ThreadKDP &thread, uint32_t concrete_frame_idx) : + RegisterContextDarwin_i386 (thread, concrete_frame_idx), + m_kdp_thread (thread) { } @@ -32,22 +33,37 @@ RegisterContextKDP_i386::~RegisterContextKDP_i386() int RegisterContextKDP_i386::DoReadGPR (lldb::tid_t tid, int flavor, GPR &gpr) { - mach_msg_type_number_t count = GPRWordCount; - return ::thread_get_state(tid, flavor, (thread_state_t)&gpr, &count); + Error error; + if (m_kdp_thread.GetKDPProcess().GetCommunication().SendRequestReadRegisters (tid, GPRRegSet, &gpr, sizeof(gpr), error)) + { + if (error.Success()) + return 0; + } + return -1; } int RegisterContextKDP_i386::DoReadFPU (lldb::tid_t tid, int flavor, FPU &fpu) { - mach_msg_type_number_t count = FPUWordCount; - return ::thread_get_state(tid, flavor, (thread_state_t)&fpu, &count); + Error error; + if (m_kdp_thread.GetKDPProcess().GetCommunication().SendRequestReadRegisters (tid, FPURegSet, &fpu, sizeof(fpu), error)) + { + if (error.Success()) + return 0; + } + return -1; } int RegisterContextKDP_i386::DoReadEXC (lldb::tid_t tid, int flavor, EXC &exc) { - mach_msg_type_number_t count = EXCWordCount; - return ::thread_get_state(tid, flavor, (thread_state_t)&exc, &count); + Error error; + if (m_kdp_thread.GetKDPProcess().GetCommunication().SendRequestReadRegisters (tid, EXCRegSet, &exc, sizeof(exc), error)) + { + if (error.Success()) + return 0; + } + return -1; } int |

