1 //===-- RegisterContextMach_arm.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__)
12 #include "RegisterContextMach_arm.h"
15 #include <mach/mach_types.h>
16 #include <mach/thread_act.h>
19 // Other libraries and framework includes
23 using namespace lldb_private;
26 RegisterContextMach_arm::RegisterContextMach_arm(Thread &thread, uint32_t concrete_frame_idx) :
27 RegisterContextDarwin_arm (thread, concrete_frame_idx)
31 RegisterContextMach_arm::~RegisterContextMach_arm()
36 RegisterContextMach_arm::DoReadGPR (lldb::tid_t tid, int flavor, GPR &gpr)
38 mach_msg_type_number_t count = GPRWordCount;
39 return ::thread_get_state(tid, flavor, (thread_state_t)&gpr, &count);
43 RegisterContextMach_arm::DoReadFPU (lldb::tid_t tid, int flavor, FPU &fpu)
45 mach_msg_type_number_t count = FPUWordCount;
46 return ::thread_get_state(tid, flavor, (thread_state_t)&fpu, &count);
50 RegisterContextMach_arm::DoReadEXC (lldb::tid_t tid, int flavor, EXC &exc)
52 mach_msg_type_number_t count = EXCWordCount;
53 return ::thread_get_state(tid, flavor, (thread_state_t)&exc, &count);
57 RegisterContextMach_arm::DoReadDBG (lldb::tid_t tid, int flavor, DBG &dbg)
59 mach_msg_type_number_t count = DBGWordCount;
60 return ::thread_get_state(tid, flavor, (thread_state_t)&dbg, &count);
64 RegisterContextMach_arm::DoWriteGPR (lldb::tid_t tid, int flavor, const GPR &gpr)
66 return ::thread_set_state(tid, flavor, (thread_state_t)&gpr, GPRWordCount);
70 RegisterContextMach_arm::DoWriteFPU (lldb::tid_t tid, int flavor, const FPU &fpu)
72 return ::thread_set_state(tid, flavor, (thread_state_t)&fpu, FPUWordCount);
76 RegisterContextMach_arm::DoWriteEXC (lldb::tid_t tid, int flavor, const EXC &exc)
78 return ::thread_set_state(tid, flavor, (thread_state_t)&exc, EXCWordCount);
82 RegisterContextMach_arm::DoWriteDBG (lldb::tid_t tid, int flavor, const DBG &dbg)
84 return ::thread_set_state(tid, flavor, (thread_state_t)&dbg, DBGWordCount);