1 //===-- RegisterContextMach_i386.cpp ----------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #if defined(__APPLE__)
13 #include <mach/thread_act.h>
16 // Other libraries and framework includes
18 #include "RegisterContextMach_i386.h"
21 using namespace lldb_private;
24 RegisterContextMach_i386::RegisterContextMach_i386(Thread &thread, uint32_t concrete_frame_idx) :
25 RegisterContextDarwin_i386 (thread, concrete_frame_idx)
29 RegisterContextMach_i386::~RegisterContextMach_i386()
34 RegisterContextMach_i386::DoReadGPR (lldb::tid_t tid, int flavor, GPR &gpr)
36 mach_msg_type_number_t count = GPRWordCount;
37 return ::thread_get_state(tid, flavor, (thread_state_t)&gpr, &count);
41 RegisterContextMach_i386::DoReadFPU (lldb::tid_t tid, int flavor, FPU &fpu)
43 mach_msg_type_number_t count = FPUWordCount;
44 return ::thread_get_state(tid, flavor, (thread_state_t)&fpu, &count);
48 RegisterContextMach_i386::DoReadEXC (lldb::tid_t tid, int flavor, EXC &exc)
50 mach_msg_type_number_t count = EXCWordCount;
51 return ::thread_get_state(tid, flavor, (thread_state_t)&exc, &count);
55 RegisterContextMach_i386::DoWriteGPR (lldb::tid_t tid, int flavor, const GPR &gpr)
57 return ::thread_set_state(tid, flavor, (thread_state_t)&gpr, GPRWordCount);
61 RegisterContextMach_i386::DoWriteFPU (lldb::tid_t tid, int flavor, const FPU &fpu)
63 return ::thread_set_state(tid, flavor, (thread_state_t)&fpu, FPUWordCount);
67 RegisterContextMach_i386::DoWriteEXC (lldb::tid_t tid, int flavor, const EXC &exc)
69 return ::thread_set_state(tid, flavor, (thread_state_t)&exc, EXCWordCount);