LLDB mainline
RegisterContextKDP_i386.cpp
Go to the documentation of this file.
1//===-- RegisterContextKDP_i386.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 uint32_t concrete_frame_idx)
18 : RegisterContextDarwin_i386(thread, concrete_frame_idx),
19 m_kdp_thread(thread) {}
20
22
24 ProcessSP process_sp(CalculateProcess());
25 if (process_sp) {
27 if (static_cast<ProcessKDP *>(process_sp.get())
30 error)) {
31 if (error.Success())
32 return 0;
33 }
34 }
35 return -1;
36}
37
39 ProcessSP process_sp(CalculateProcess());
40 if (process_sp) {
42 if (static_cast<ProcessKDP *>(process_sp.get())
45 error)) {
46 if (error.Success())
47 return 0;
48 }
49 }
50 return -1;
51}
52
54 ProcessSP process_sp(CalculateProcess());
55 if (process_sp) {
57 if (static_cast<ProcessKDP *>(process_sp.get())
60 error)) {
61 if (error.Success())
62 return 0;
63 }
64 }
65 return -1;
66}
67
69 const GPR &gpr) {
70 ProcessSP process_sp(CalculateProcess());
71 if (process_sp) {
73 if (static_cast<ProcessKDP *>(process_sp.get())
76 error)) {
77 if (error.Success())
78 return 0;
79 }
80 }
81 return -1;
82}
83
85 const FPU &fpu) {
86 ProcessSP process_sp(CalculateProcess());
87 if (process_sp) {
89 if (static_cast<ProcessKDP *>(process_sp.get())
92 error)) {
93 if (error.Success())
94 return 0;
95 }
96 }
97 return -1;
98}
99
101 const EXC &exc) {
102 ProcessSP process_sp(CalculateProcess());
103 if (process_sp) {
105 if (static_cast<ProcessKDP *>(process_sp.get())
108 error)) {
109 if (error.Success())
110 return 0;
111 }
112 }
113 return -1;
114}
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
RegisterContextKDP_i386(ThreadKDP &thread, uint32_t concrete_frame_idx)
int DoReadEXC(lldb::tid_t tid, int flavor, EXC &exc) override
int DoWriteGPR(lldb::tid_t tid, int flavor, const GPR &gpr) override
int DoWriteFPU(lldb::tid_t tid, int flavor, const FPU &fpu) override
int DoReadGPR(lldb::tid_t tid, int flavor, GPR &gpr) override
int DoWriteEXC(lldb::tid_t tid, int flavor, const EXC &exc) override
int DoReadFPU(lldb::tid_t tid, int flavor, FPU &fpu) override
~RegisterContextKDP_i386() override
lldb::ProcessSP CalculateProcess() override
An error handling class.
Definition: Status.h:44
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
Definition: SBAddress.h:15
std::shared_ptr< lldb_private::Process > ProcessSP
Definition: lldb-forward.h:381
uint64_t tid_t
Definition: lldb-types.h:82