LLDB  mainline
RegisterContextMach_x86_64.cpp
Go to the documentation of this file.
1 //===-- RegisterContextMach_x86_64.cpp --------------------------*- C++ -*-===//
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 
15 using namespace lldb;
16 using 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)),
46  GPRWordCount);
47 }
48 
50  const FPU &fpu) {
51  return ::thread_set_state(
52  tid, flavor, reinterpret_cast<thread_state_t>(const_cast<FPU *>(&fpu)),
53  FPUWordCount);
54 }
55 
57  const EXC &exc) {
58  return ::thread_set_state(
59  tid, flavor, reinterpret_cast<thread_state_t>(const_cast<EXC *>(&exc)),
60  EXCWordCount);
61 }
62 
63 #endif
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
int DoWriteFPU(lldb::tid_t tid, int flavor, const FPU &fpu)
int DoWriteGPR(lldb::tid_t tid, int flavor, const GPR &gpr)
int DoWriteEXC(lldb::tid_t tid, int flavor, const EXC &exc)
uint64_t tid_t
Definition: lldb-types.h:86
virtual int DoReadGPR(lldb::tid_t tid, int flavor, GPR &gpr)
RegisterContextMach_x86_64(lldb_private::Thread &thread, uint32_t concrete_frame_idx)
virtual ~RegisterContextMach_x86_64()
int DoReadFPU(lldb::tid_t tid, int flavor, FPU &fpu)
Definition: SBAddress.h:15
int DoReadEXC(lldb::tid_t tid, int flavor, EXC &exc)