LLDB mainline
RegisterContextKDP_x86_64.cpp
Go to the documentation of this file.
1//===-- RegisterContextKDP_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
10#include "ProcessKDP.h"
11#include "ThreadKDP.h"
12
13using namespace lldb;
14using namespace lldb_private;
15
17 ThreadKDP &thread, uint32_t concrete_frame_idx)
18 : RegisterContextDarwin_x86_64(thread, concrete_frame_idx),
19 m_kdp_thread(thread) {}
20
22
24 GPR &gpr) {
25 ProcessSP process_sp(CalculateProcess());
26 if (process_sp) {
28 if (static_cast<ProcessKDP *>(process_sp.get())
31 error)) {
32 if (error.Success())
33 return 0;
34 }
35 }
36 return -1;
37}
38
40 FPU &fpu) {
41 ProcessSP process_sp(CalculateProcess());
42 if (process_sp) {
44 if (static_cast<ProcessKDP *>(process_sp.get())
47 error)) {
48 if (error.Success())
49 return 0;
50 }
51 }
52 return -1;
53}
54
56 EXC &exc) {
57 ProcessSP process_sp(CalculateProcess());
58 if (process_sp) {
60 if (static_cast<ProcessKDP *>(process_sp.get())
63 error)) {
64 if (error.Success())
65 return 0;
66 }
67 }
68 return -1;
69}
70
72 const GPR &gpr) {
73 ProcessSP process_sp(CalculateProcess());
74 if (process_sp) {
76 if (static_cast<ProcessKDP *>(process_sp.get())
79 error)) {
80 if (error.Success())
81 return 0;
82 }
83 }
84 return -1;
85}
86
88 const FPU &fpu) {
89 ProcessSP process_sp(CalculateProcess());
90 if (process_sp) {
92 if (static_cast<ProcessKDP *>(process_sp.get())
95 error)) {
96 if (error.Success())
97 return 0;
98 }
99 }
100 return -1;
101}
102
104 const EXC &exc) {
105 ProcessSP process_sp(CalculateProcess());
106 if (process_sp) {
108 if (static_cast<ProcessKDP *>(process_sp.get())
111 error)) {
112 if (error.Success())
113 return 0;
114 }
115 }
116 return -1;
117}
static llvm::raw_ostream & error(Stream &strm)
uint32_t SendRequestReadRegisters(uint32_t cpu, uint32_t flavor, void *dst, uint32_t dst_size, lldb_private::Status &error)
uint32_t SendRequestWriteRegisters(uint32_t cpu, uint32_t flavor, const void *src, uint32_t src_size, lldb_private::Status &error)
CommunicationKDP & GetCommunication()
Definition: ProcessKDP.h:127
int DoWriteGPR(lldb::tid_t tid, int flavor, const GPR &gpr) override
int DoReadGPR(lldb::tid_t tid, int flavor, GPR &gpr) override
RegisterContextKDP_x86_64(ThreadKDP &thread, uint32_t concrete_frame_idx)
int DoWriteFPU(lldb::tid_t tid, int flavor, const FPU &fpu) override
int DoReadFPU(lldb::tid_t tid, int flavor, FPU &fpu) override
int DoReadEXC(lldb::tid_t tid, int flavor, EXC &exc) override
int DoWriteEXC(lldb::tid_t tid, int flavor, const EXC &exc) override
~RegisterContextKDP_x86_64() override
lldb::ProcessSP CalculateProcess() override
An error handling class.
Definition: Status.h:115
A class that represents a running process on the host machine.
Definition: SBAddress.h:15
std::shared_ptr< lldb_private::Process > ProcessSP
Definition: lldb-forward.h:389
uint64_t tid_t
Definition: lldb-types.h:84