1 //===-- RegisterContextMach_x86_64.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_x86_64.h"
21 using namespace lldb_private;
23 RegisterContextMach_x86_64::RegisterContextMach_x86_64(
24 Thread &thread, uint32_t concrete_frame_idx)
25 : RegisterContextDarwin_x86_64(thread, concrete_frame_idx) {}
27 RegisterContextMach_x86_64::~RegisterContextMach_x86_64() {}
29 int RegisterContextMach_x86_64::DoReadGPR(lldb::tid_t tid, int flavor,
31 mach_msg_type_number_t count = GPRWordCount;
32 return ::thread_get_state(tid, flavor, (thread_state_t)&gpr, &count);
35 int RegisterContextMach_x86_64::DoReadFPU(lldb::tid_t tid, int flavor,
37 mach_msg_type_number_t count = FPUWordCount;
38 return ::thread_get_state(tid, flavor, (thread_state_t)&fpu, &count);
41 int RegisterContextMach_x86_64::DoReadEXC(lldb::tid_t tid, int flavor,
43 mach_msg_type_number_t count = EXCWordCount;
44 return ::thread_get_state(tid, flavor, (thread_state_t)&exc, &count);
47 int RegisterContextMach_x86_64::DoWriteGPR(lldb::tid_t tid, int flavor,
49 return ::thread_set_state(tid, flavor, (thread_state_t)&gpr, GPRWordCount);
52 int RegisterContextMach_x86_64::DoWriteFPU(lldb::tid_t tid, int flavor,
54 return ::thread_set_state(tid, flavor, (thread_state_t)&fpu, FPUWordCount);
57 int RegisterContextMach_x86_64::DoWriteEXC(lldb::tid_t tid, int flavor,
59 return ::thread_set_state(tid, flavor, (thread_state_t)&exc, EXCWordCount);