1 //===-- RegisterContextMach_x86_64.cpp --------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 #include <mach/thread_act.h>
13 #include "RegisterContextMach_x86_64.h"
16 using namespace lldb_private;
18 RegisterContextMach_x86_64::RegisterContextMach_x86_64(
19 Thread &thread, uint32_t concrete_frame_idx)
20 : RegisterContextDarwin_x86_64(thread, concrete_frame_idx) {}
22 RegisterContextMach_x86_64::~RegisterContextMach_x86_64() {}
24 int RegisterContextMach_x86_64::DoReadGPR(lldb::tid_t tid, int flavor,
26 mach_msg_type_number_t count = GPRWordCount;
27 return ::thread_get_state(tid, flavor, (thread_state_t)&gpr, &count);
30 int RegisterContextMach_x86_64::DoReadFPU(lldb::tid_t tid, int flavor,
32 mach_msg_type_number_t count = FPUWordCount;
33 return ::thread_get_state(tid, flavor, (thread_state_t)&fpu, &count);
36 int RegisterContextMach_x86_64::DoReadEXC(lldb::tid_t tid, int flavor,
38 mach_msg_type_number_t count = EXCWordCount;
39 return ::thread_get_state(tid, flavor, (thread_state_t)&exc, &count);
42 int RegisterContextMach_x86_64::DoWriteGPR(lldb::tid_t tid, int flavor,
44 return ::thread_set_state(
45 tid, flavor, reinterpret_cast<thread_state_t>(const_cast<GPR *>(&gpr)),
49 int RegisterContextMach_x86_64::DoWriteFPU(lldb::tid_t tid, int flavor,
51 return ::thread_set_state(
52 tid, flavor, reinterpret_cast<thread_state_t>(const_cast<FPU *>(&fpu)),
56 int RegisterContextMach_x86_64::DoWriteEXC(lldb::tid_t tid, int flavor,
58 return ::thread_set_state(
59 tid, flavor, reinterpret_cast<thread_state_t>(const_cast<EXC *>(&exc)),