LLDB mainline
RegisterContextMach_x86_64.cpp
Go to the documentation of this file.
1//===-- RegisterContextMach_x86_64.cpp ------------------------------------===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9#if defined(__APPLE__)
10
11#include <mach/thread_act.h>
12
14
15using namespace lldb;
16using namespace lldb_private;
17
19 Thread &thread, uint32_t concrete_frame_idx)
20 : RegisterContextDarwin_x86_64(thread, concrete_frame_idx) {}
21
23
25 GPR &gpr) {
26 mach_msg_type_number_t count = GPRWordCount;
27 return ::thread_get_state(tid, flavor, (thread_state_t)&gpr, &count);
28}
29
31 FPU &fpu) {
32 mach_msg_type_number_t count = FPUWordCount;
33 return ::thread_get_state(tid, flavor, (thread_state_t)&fpu, &count);
34}
35
37 EXC &exc) {
38 mach_msg_type_number_t count = EXCWordCount;
39 return ::thread_get_state(tid, flavor, (thread_state_t)&exc, &count);
40}
41
43 const GPR &gpr) {
44 return ::thread_set_state(
45 tid, flavor, reinterpret_cast<thread_state_t>(const_cast<GPR *>(&gpr)),
47}
48
50 const FPU &fpu) {
51 return ::thread_set_state(
52 tid, flavor, reinterpret_cast<thread_state_t>(const_cast<FPU *>(&fpu)),
54}
55
57 const EXC &exc) {
58 return ::thread_set_state(
59 tid, flavor, reinterpret_cast<thread_state_t>(const_cast<EXC *>(&exc)),
61}
62
63#endif
int DoReadEXC(lldb::tid_t tid, int flavor, EXC &exc) override
RegisterContextMach_x86_64(lldb_private::Thread &thread, uint32_t concrete_frame_idx)
int DoReadFPU(lldb::tid_t tid, int flavor, FPU &fpu) override
int DoReadGPR(lldb::tid_t tid, int flavor, GPR &gpr) override
int DoWriteGPR(lldb::tid_t tid, int flavor, const GPR &gpr) override
int DoWriteEXC(lldb::tid_t tid, int flavor, const EXC &exc) override
~RegisterContextMach_x86_64() override
int DoWriteFPU(lldb::tid_t tid, int flavor, const FPU &fpu) override
A class that represents a running process on the host machine.
Definition: SBAddress.h:15
uint64_t tid_t
Definition: lldb-types.h:84