LLDB  mainline
RegisterContext.cpp
Go to the documentation of this file.
1 //===-- RegisterContext.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 "lldb/Core/Module.h"
11 #include "lldb/Core/Value.h"
14 #include "lldb/Target/Process.h"
15 #include "lldb/Target/StackFrame.h"
16 #include "lldb/Target/Target.h"
17 #include "lldb/Target/Thread.h"
19 #include "lldb/Utility/Endian.h"
21 #include "lldb/Utility/Scalar.h"
22 
23 using namespace lldb;
24 using namespace lldb_private;
25 
26 RegisterContext::RegisterContext(Thread &thread, uint32_t concrete_frame_idx)
27  : m_thread(thread), m_concrete_frame_idx(concrete_frame_idx),
28  m_stop_id(thread.GetProcess()->GetStopID()) {}
29 
31 
33  ProcessSP process_sp(m_thread.GetProcess());
34  bool invalidate = force;
35  uint32_t process_stop_id = UINT32_MAX;
36 
37  if (process_sp)
38  process_stop_id = process_sp->GetStopID();
39  else
40  invalidate = true;
41 
42  if (!invalidate)
43  invalidate = process_stop_id != GetStopID();
44 
45  if (invalidate) {
47  SetStopID(process_stop_id);
48  }
49 }
50 
51 const RegisterInfo *
52 RegisterContext::GetRegisterInfoByName(llvm::StringRef reg_name,
53  uint32_t start_idx) {
54  if (reg_name.empty())
55  return nullptr;
56 
57  // Generic register names take precedence over specific register names.
58  // For example, on x86 we want "sp" to refer to the complete RSP/ESP register
59  // rather than the 16-bit SP pseudo-register.
60  uint32_t generic_reg = Args::StringToGenericRegister(reg_name);
61  if (generic_reg != LLDB_INVALID_REGNUM) {
62  const RegisterInfo *reg_info =
64  if (reg_info)
65  return reg_info;
66  }
67 
68  const uint32_t num_registers = GetRegisterCount();
69  for (uint32_t reg = start_idx; reg < num_registers; ++reg) {
70  const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg);
71 
72  if (reg_name.equals_insensitive(reg_info->name) ||
73  reg_name.equals_insensitive(reg_info->alt_name))
74  return reg_info;
75  }
76 
77  return nullptr;
78 }
79 
81  uint32_t num) {
82  const uint32_t reg_num = ConvertRegisterKindToRegisterNumber(kind, num);
83  if (reg_num == LLDB_INVALID_REGNUM)
84  return nullptr;
85  return GetRegisterInfoAtIndex(reg_num);
86 }
87 
89  const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg);
90  if (reg_info)
91  return reg_info->name;
92  return nullptr;
93 }
94 
95 uint64_t RegisterContext::GetPC(uint64_t fail_value) {
98  uint64_t pc = ReadRegisterAsUnsigned(reg, fail_value);
99 
100  if (pc != fail_value) {
101  TargetSP target_sp = m_thread.CalculateTarget();
102  if (target_sp) {
103  Target *target = target_sp.get();
104  if (target)
106  }
107  }
108 
109  return pc;
110 }
111 
112 bool RegisterContext::SetPC(uint64_t pc) {
115  bool success = WriteRegisterFromUnsigned(reg, pc);
116  if (success) {
117  StackFrameSP frame_sp(
119  if (frame_sp)
120  frame_sp->ChangePC(pc);
121  else
123  }
124  return success;
125 }
126 
129  if (pc == LLDB_INVALID_ADDRESS)
130  return false;
131  TargetSP target_sp = m_thread.CalculateTarget();
132  if (!target_sp.get())
133  return false;
134 
135  if (!BehavesLikeZerothFrame() && pc != 0)
136  pc--;
137  address.SetLoadAddress(pc, target_sp.get());
138  return true;
139 }
140 
142  TargetSP target_sp = m_thread.CalculateTarget();
143  Target *target = target_sp.get();
144 
145  lldb::addr_t callAddr = addr.GetCallableLoadAddress(target);
146  if (callAddr == LLDB_INVALID_ADDRESS)
147  return false;
148 
149  return SetPC(callAddr);
150 }
151 
152 uint64_t RegisterContext::GetSP(uint64_t fail_value) {
155  return ReadRegisterAsUnsigned(reg, fail_value);
156 }
157 
158 bool RegisterContext::SetSP(uint64_t sp) {
161  return WriteRegisterFromUnsigned(reg, sp);
162 }
163 
164 uint64_t RegisterContext::GetFP(uint64_t fail_value) {
167  return ReadRegisterAsUnsigned(reg, fail_value);
168 }
169 
170 bool RegisterContext::SetFP(uint64_t fp) {
173  return WriteRegisterFromUnsigned(reg, fp);
174 }
175 
176 uint64_t RegisterContext::GetReturnAddress(uint64_t fail_value) {
179  return ReadRegisterAsUnsigned(reg, fail_value);
180 }
181 
182 uint64_t RegisterContext::GetFlags(uint64_t fail_value) {
185  return ReadRegisterAsUnsigned(reg, fail_value);
186 }
187 
189  uint64_t fail_value) {
190  if (reg != LLDB_INVALID_REGNUM)
191  return ReadRegisterAsUnsigned(GetRegisterInfoAtIndex(reg), fail_value);
192  return fail_value;
193 }
194 
195 uint64_t RegisterContext::ReadRegisterAsUnsigned(const RegisterInfo *reg_info,
196  uint64_t fail_value) {
197  if (reg_info) {
198  RegisterValue value;
199  if (ReadRegister(reg_info, value))
200  return value.GetAsUInt64();
201  }
202  return fail_value;
203 }
204 
206  if (reg == LLDB_INVALID_REGNUM)
207  return false;
209 }
210 
211 bool RegisterContext::WriteRegisterFromUnsigned(const RegisterInfo *reg_info,
212  uint64_t uval) {
213  if (reg_info) {
214  RegisterValue value;
215  if (value.SetUInt(uval, reg_info->byte_size))
216  return WriteRegister(reg_info, value);
217  }
218  return false;
219 }
220 
221 bool RegisterContext::CopyFromRegisterContext(lldb::RegisterContextSP context) {
222  uint32_t num_register_sets = context->GetRegisterSetCount();
223  // We don't know that two threads have the same register context, so require
224  // the threads to be the same.
225  if (context->GetThreadID() != GetThreadID())
226  return false;
227 
228  if (num_register_sets != GetRegisterSetCount())
229  return false;
230 
231  RegisterContextSP frame_zero_context = m_thread.GetRegisterContext();
232 
233  for (uint32_t set_idx = 0; set_idx < num_register_sets; ++set_idx) {
234  const RegisterSet *const reg_set = GetRegisterSet(set_idx);
235 
236  const uint32_t num_registers = reg_set->num_registers;
237  for (uint32_t reg_idx = 0; reg_idx < num_registers; ++reg_idx) {
238  const uint32_t reg = reg_set->registers[reg_idx];
239  const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg);
240  if (!reg_info || reg_info->value_regs)
241  continue;
242  RegisterValue reg_value;
243 
244  // If we can reconstruct the register from the frame we are copying from,
245  // then do so, otherwise use the value from frame 0.
246  if (context->ReadRegister(reg_info, reg_value)) {
247  WriteRegister(reg_info, reg_value);
248  } else if (frame_zero_context->ReadRegister(reg_info, reg_value)) {
249  WriteRegister(reg_info, reg_value);
250  }
251  }
252  }
253  return true;
254 }
255 
257 
259 
261  size_t size) {
262  return LLDB_INVALID_INDEX32;
263 }
264 
265 // Used when parsing DWARF and EH frame information and any other object file
266 // sections that contain register numbers in them.
267 uint32_t
269  uint32_t num) {
270  const uint32_t num_regs = GetRegisterCount();
271 
272  assert(kind < kNumRegisterKinds);
273  for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx) {
274  const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg_idx);
275 
276  if (reg_info->kinds[kind] == num)
277  return reg_idx;
278  }
279 
280  return LLDB_INVALID_REGNUM;
281 }
282 
284 
286 
288  bool read, bool write) {
289  return LLDB_INVALID_INDEX32;
290 }
291 
293  return false;
294 }
295 
296 bool RegisterContext::HardwareSingleStep(bool enable) { return false; }
297 
299  const RegisterInfo *reg_info, lldb::addr_t src_addr, uint32_t src_len,
300  RegisterValue &reg_value) {
301  Status error;
302  if (reg_info == nullptr) {
303  error.SetErrorString("invalid register info argument.");
304  return error;
305  }
306 
307  // Moving from addr into a register
308  //
309  // Case 1: src_len == dst_len
310  //
311  // |AABBCCDD| Address contents
312  // |AABBCCDD| Register contents
313  //
314  // Case 2: src_len > dst_len
315  //
316  // Status! (The register should always be big enough to hold the data)
317  //
318  // Case 3: src_len < dst_len
319  //
320  // |AABB| Address contents
321  // |AABB0000| Register contents [on little-endian hardware]
322  // |0000AABB| Register contents [on big-endian hardware]
323  if (src_len > RegisterValue::kMaxRegisterByteSize) {
324  error.SetErrorString("register too small to receive memory data");
325  return error;
326  }
327 
328  const uint32_t dst_len = reg_info->byte_size;
329 
330  if (src_len > dst_len) {
331  error.SetErrorStringWithFormat(
332  "%u bytes is too big to store in register %s (%u bytes)", src_len,
333  reg_info->name, dst_len);
334  return error;
335  }
336 
337  ProcessSP process_sp(m_thread.GetProcess());
338  if (process_sp) {
340 
341  // Read the memory
342  const uint32_t bytes_read =
343  process_sp->ReadMemory(src_addr, src, src_len, error);
344 
345  // Make sure the memory read succeeded...
346  if (bytes_read != src_len) {
347  if (error.Success()) {
348  // This might happen if we read _some_ bytes but not all
349  error.SetErrorStringWithFormat("read %u of %u bytes", bytes_read,
350  src_len);
351  }
352  return error;
353  }
354 
355  // We now have a memory buffer that contains the part or all of the
356  // register value. Set the register value using this memory data.
357  // TODO: we might need to add a parameter to this function in case the byte
358  // order of the memory data doesn't match the process. For now we are
359  // assuming they are the same.
360  reg_value.SetFromMemoryData(reg_info, src, src_len,
361  process_sp->GetByteOrder(), error);
362  } else
363  error.SetErrorString("invalid process");
364 
365  return error;
366 }
367 
369  const RegisterInfo *reg_info, lldb::addr_t dst_addr, uint32_t dst_len,
370  const RegisterValue &reg_value) {
372 
373  Status error;
374 
375  ProcessSP process_sp(m_thread.GetProcess());
376  if (process_sp) {
377 
378  // TODO: we might need to add a parameter to this function in case the byte
379  // order of the memory data doesn't match the process. For now we are
380  // assuming they are the same.
381 
382  const uint32_t bytes_copied = reg_value.GetAsMemoryData(
383  reg_info, dst, dst_len, process_sp->GetByteOrder(), error);
384 
385  if (error.Success()) {
386  if (bytes_copied == 0) {
387  error.SetErrorString("byte copy failed.");
388  } else {
389  const uint32_t bytes_written =
390  process_sp->WriteMemory(dst_addr, dst, bytes_copied, error);
391  if (bytes_written != bytes_copied) {
392  if (error.Success()) {
393  // This might happen if we read _some_ bytes but not all
394  error.SetErrorStringWithFormat("only wrote %u of %u bytes",
395  bytes_written, bytes_copied);
396  }
397  }
398  }
399  }
400  } else
401  error.SetErrorString("invalid process");
402 
403  return error;
404 }
405 
407  // Get the target process whose privileged thread was used for the register
408  // read.
410  lldb_private::Process *process = CalculateProcess().get();
411 
412  if (process)
413  byte_order = process->GetByteOrder();
414  return byte_order;
415 }
416 
418  lldb_private::RegisterCheckpoint &reg_checkpoint) {
419  return ReadAllRegisterValues(reg_checkpoint.GetData());
420 }
421 
423  const lldb_private::RegisterCheckpoint &reg_checkpoint) {
424  return WriteAllRegisterValues(reg_checkpoint.GetData());
425 }
426 
428  return m_thread.CalculateTarget();
429 }
430 
432  return m_thread.CalculateProcess();
433 }
434 
436  return m_thread.shared_from_this();
437 }
438 
440  // Register contexts might belong to many frames if we have inlined functions
441  // inside a frame since all inlined functions share the same registers, so we
442  // can't definitively say which frame we come from...
443  return StackFrameSP();
444 }
445 
448 }
449 
451  uint32_t source_regnum,
452  lldb::RegisterKind target_rk,
453  uint32_t &target_regnum) {
454  const uint32_t num_registers = GetRegisterCount();
455  for (uint32_t reg = 0; reg < num_registers; ++reg) {
456  const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg);
457 
458  if (reg_info->kinds[source_rk] == source_regnum) {
459  target_regnum = reg_info->kinds[target_rk];
460  return (target_regnum != LLDB_INVALID_REGNUM);
461  }
462  }
463  return false;
464 }
lldb_private::Address::SetLoadAddress
bool SetLoadAddress(lldb::addr_t load_addr, Target *target, bool allow_section_end=false)
Set the address to represent load_addr.
Definition: Address.cpp:1023
lldb_private::RegisterContext::WriteRegister
virtual bool WriteRegister(const RegisterInfo *reg_info, const RegisterValue &reg_value)=0
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
Scalar.h
LLDB_INVALID_REGNUM
#define LLDB_INVALID_REGNUM
Definition: lldb-defines.h:91
lldb_private::RegisterContext::GetRegisterCount
virtual size_t GetRegisterCount()=0
lldb_private::RegisterContext::GetStopID
uint32_t GetStopID() const
Definition: RegisterContext.h:215
lldb_private::RegisterValue
Definition: RegisterValue.h:28
lldb_private::RegisterContext::WriteRegisterValueToMemory
virtual Status WriteRegisterValueToMemory(const lldb_private::RegisterInfo *reg_info, lldb::addr_t dst_addr, uint32_t dst_len, const RegisterValue &reg_value)
Definition: RegisterContext.cpp:368
lldb_private::RegisterContext::GetRegisterName
const char * GetRegisterName(uint32_t reg)
Definition: RegisterContext.cpp:88
lldb_private::RegisterContext::CalculateStackFrame
lldb::StackFrameSP CalculateStackFrame() override
Definition: RegisterContext.cpp:439
lldb::eRegisterKindGeneric
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
Definition: lldb-enumerations.h:230
lldb_private::Thread::ClearStackFrames
virtual void ClearStackFrames()
Definition: Thread.cpp:1417
lldb_private::RegisterCheckpoint::GetData
lldb::DataBufferSP & GetData()
Definition: RegisterCheckpoint.h:39
lldb_private::RegisterContext::GetRegisterSet
virtual const RegisterSet * GetRegisterSet(size_t reg_set)=0
lldb_private::RegisterContext::ReadRegister
virtual bool ReadRegister(const RegisterInfo *reg_info, RegisterValue &reg_value)=0
lldb_private::Process
Definition: Process.h:341
lldb_private::Thread::CalculateTarget
lldb::TargetSP CalculateTarget() override
Definition: Thread.cpp:1389
Module.h
lldb_private::RegisterContext::ReadAllRegisterValues
virtual bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp)
Definition: RegisterContext.h:46
lldb_private::RegisterContext::ConvertRegisterKindToRegisterNumber
virtual uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num)
Convert from a given register numbering scheme to the lldb register numbering scheme.
Definition: RegisterContext.cpp:268
lldb_private::RegisterContext::ReadRegisterAsUnsigned
uint64_t ReadRegisterAsUnsigned(uint32_t reg, uint64_t fail_value)
Definition: RegisterContext.cpp:188
lldb_private::Args::StringToGenericRegister
static uint32_t StringToGenericRegister(llvm::StringRef s)
Definition: Args.cpp:425
lldb::kNumRegisterKinds
@ kNumRegisterKinds
Definition: lldb-enumerations.h:235
RegisterValue.h
StackFrame.h
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
pc
@ pc
Definition: CompactUnwindInfo.cpp:1250
lldb_private::RegisterContext::GetPCForSymbolication
bool GetPCForSymbolication(Address &address)
Get an address suitable for symbolication.
Definition: RegisterContext.cpp:127
lldb_private::RegisterContext::GetRegisterInfoAtIndex
virtual const RegisterInfo * GetRegisterInfoAtIndex(size_t reg)=0
lldb_private::Target
Definition: Target.h:451
lldb_private::RegisterContext::InvalidateIfNeeded
void InvalidateIfNeeded(bool force)
Definition: RegisterContext.cpp:32
lldb_private::RegisterContext::GetThreadID
virtual lldb::tid_t GetThreadID() const
Definition: RegisterContext.cpp:256
lldb_private::RegisterContext::NumSupportedHardwareBreakpoints
virtual uint32_t NumSupportedHardwareBreakpoints()
Definition: RegisterContext.cpp:258
Process.h
lldb_private::RegisterValue::GetAsUInt64
uint64_t GetAsUInt64(uint64_t fail_value=UINT64_MAX, bool *success_ptr=nullptr) const
Definition: RegisterValue.cpp:563
Target.h
lldb_private::RegisterContext::BehavesLikeZerothFrame
virtual bool BehavesLikeZerothFrame() const
Indicates that this frame is currently executing code, that the PC value is not a return-pc but an ac...
Definition: RegisterContext.h:229
lldb_private::RegisterContext::ClearHardwareBreakpoint
virtual bool ClearHardwareBreakpoint(uint32_t hw_idx)
Definition: RegisterContext.cpp:283
lldb_private::Thread::GetProcess
lldb::ProcessSP GetProcess() const
Definition: Thread.h:152
LLDB_REGNUM_GENERIC_FLAGS
#define LLDB_REGNUM_GENERIC_FLAGS
Definition: lldb-defines.h:67
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::RegisterContext::m_thread
Thread & m_thread
Definition: RegisterContext.h:234
lldb_private::Thread::CalculateProcess
lldb::ProcessSP CalculateProcess() override
Definition: Thread.cpp:1397
lldb_private::RegisterContext::CalculateProcess
lldb::ProcessSP CalculateProcess() override
Definition: RegisterContext.cpp:431
lldb_private::RegisterContext::CalculateExecutionContext
void CalculateExecutionContext(ExecutionContext &exe_ctx) override
Reconstruct the object's execution context into sc.
Definition: RegisterContext.cpp:446
lldb_private::RegisterContext::HardwareSingleStep
virtual bool HardwareSingleStep(bool enable)
Definition: RegisterContext.cpp:296
lldb_private::RegisterContext::GetPC
uint64_t GetPC(uint64_t fail_value=LLDB_INVALID_ADDRESS)
Definition: RegisterContext.cpp:95
lldb_private::RegisterContext::~RegisterContext
~RegisterContext() override
lldb_private::Thread
Definition: Thread.h:60
lldb_private::Address::GetCallableLoadAddress
lldb::addr_t GetCallableLoadAddress(Target *target, bool is_indirect=false) const
Get the load address as a callable code load address.
Definition: Address.cpp:335
lldb_private::RegisterContext::GetReturnAddress
uint64_t GetReturnAddress(uint64_t fail_value=LLDB_INVALID_ADDRESS)
Definition: RegisterContext.cpp:176
lldb_private::RegisterContext::GetRegisterInfo
const RegisterInfo * GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num)
Definition: RegisterContext.cpp:80
lldb_private::RegisterContext::SetPC
bool SetPC(uint64_t pc)
Definition: RegisterContext.cpp:112
lldb_private::RegisterValue::kMaxRegisterByteSize
@ kMaxRegisterByteSize
Definition: RegisterValue.h:31
lldb_private::RegisterContext::SetHardwareWatchpoint
virtual uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size, bool read, bool write)
Definition: RegisterContext.cpp:287
sp
@ sp
Definition: CompactUnwindInfo.cpp:1249
lldb_private::RegisterContext::GetFP
uint64_t GetFP(uint64_t fail_value=LLDB_INVALID_ADDRESS)
Definition: RegisterContext.cpp:164
Thread.h
lldb_private::RegisterContext::ReadRegisterValueFromMemory
virtual Status ReadRegisterValueFromMemory(const lldb_private::RegisterInfo *reg_info, lldb::addr_t src_addr, uint32_t src_len, RegisterValue &reg_value)
Definition: RegisterContext.cpp:298
lldb_private::Target::GetOpcodeLoadAddress
lldb::addr_t GetOpcodeLoadAddress(lldb::addr_t load_addr, AddressClass addr_class=AddressClass::eInvalid) const
Get load_addr as an opcode for this target.
Definition: Target.cpp:2583
lldb_private::RegisterContext::GetSP
uint64_t GetSP(uint64_t fail_value=LLDB_INVALID_ADDRESS)
Definition: RegisterContext.cpp:152
lldb_private::Thread::GetFrameWithConcreteFrameIndex
virtual lldb::StackFrameSP GetFrameWithConcreteFrameIndex(uint32_t unwind_idx)
Definition: Thread.cpp:1435
lldb_private::UserID::GetID
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition: UserID.h:47
lldb::RegisterKind
RegisterKind
Register numbering types.
Definition: lldb-enumerations.h:227
lldb_private::Thread::CalculateExecutionContext
void CalculateExecutionContext(ExecutionContext &exe_ctx) override
Reconstruct the object's execution context into sc.
Definition: Thread.cpp:1403
lldb_private::RegisterContext::GetByteOrder
virtual lldb::ByteOrder GetByteOrder()
Definition: RegisterContext.cpp:406
lldb_private::RegisterContext::GetRegisterSetCount
virtual size_t GetRegisterSetCount()=0
lldb_private::RegisterContext::SetHardwareBreakpoint
virtual uint32_t SetHardwareBreakpoint(lldb::addr_t addr, size_t size)
Definition: RegisterContext.cpp:260
lldb_private::RegisterContext::NumSupportedHardwareWatchpoints
virtual uint32_t NumSupportedHardwareWatchpoints()
Definition: RegisterContext.cpp:285
lldb_private::RegisterValue::SetFromMemoryData
uint32_t SetFromMemoryData(const RegisterInfo *reg_info, const void *src, uint32_t src_len, lldb::ByteOrder src_byte_order, Status &error)
Definition: RegisterValue.cpp:84
lldb_private::RegisterContext::SetFP
bool SetFP(uint64_t fp)
Definition: RegisterContext.cpp:170
lldb_private::Status
Definition: Status.h:44
lldb_private::RegisterContext::m_concrete_frame_idx
uint32_t m_concrete_frame_idx
Definition: RegisterContext.h:235
lldb::eByteOrderInvalid
@ eByteOrderInvalid
Definition: lldb-enumerations.h:139
lldb_private::RegisterContext::WriteRegisterFromUnsigned
bool WriteRegisterFromUnsigned(uint32_t reg, uint64_t uval)
Definition: RegisterContext.cpp:205
uint32_t
lldb_private::RegisterValue::SetUInt
bool SetUInt(uint64_t uint, uint32_t byte_size)
Definition: RegisterValue.cpp:734
lldb_private::Address
Definition: Address.h:59
LLDB_REGNUM_GENERIC_SP
#define LLDB_REGNUM_GENERIC_SP
Definition: lldb-defines.h:64
lldb_private::RegisterValue::GetAsMemoryData
uint32_t GetAsMemoryData(const RegisterInfo *reg_info, void *dst, uint32_t dst_len, lldb::ByteOrder dst_byte_order, Status &error) const
Definition: RegisterValue.cpp:38
lldb_private::AddressClass::eCode
@ eCode
lldb_private::RegisterCheckpoint
Definition: RegisterCheckpoint.h:21
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:86
lldb_private::RegisterContext::SetStopID
void SetStopID(uint32_t stop_id)
Definition: RegisterContext.h:217
DataExtractor.h
lldb_private::RegisterContext::CalculateThread
lldb::ThreadSP CalculateThread() override
Definition: RegisterContext.cpp:435
DWARFExpression.h
lldb_private::RegisterContext::SetSP
bool SetSP(uint64_t sp)
Definition: RegisterContext.cpp:158
lldb_private::RegisterContext::InvalidateAllRegisters
virtual void InvalidateAllRegisters()=0
lldb_private::RegisterContext::CalculateTarget
lldb::TargetSP CalculateTarget() override
Definition: RegisterContext.cpp:427
lldb_private::RegisterContext::WriteAllRegisterValues
virtual bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp)
Definition: RegisterContext.h:50
lldb_private::RegisterContext::ClearHardwareWatchpoint
virtual bool ClearHardwareWatchpoint(uint32_t hw_index)
Definition: RegisterContext.cpp:292
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
LLDB_REGNUM_GENERIC_FP
#define LLDB_REGNUM_GENERIC_FP
Definition: lldb-defines.h:65
lldb_private::RegisterContext::ConvertBetweenRegisterKinds
bool ConvertBetweenRegisterKinds(lldb::RegisterKind source_rk, uint32_t source_regnum, lldb::RegisterKind target_rk, uint32_t &target_regnum)
Definition: RegisterContext.cpp:450
LLDB_REGNUM_GENERIC_PC
#define LLDB_REGNUM_GENERIC_PC
Definition: lldb-defines.h:63
LLDB_INVALID_INDEX32
#define LLDB_INVALID_INDEX32
Definition: lldb-defines.h:87
lldb_private::Process::GetByteOrder
lldb::ByteOrder GetByteOrder() const
Definition: Process.cpp:3302
lldb_private::Thread::GetRegisterContext
virtual lldb::RegisterContextSP GetRegisterContext()=0
lldb_private::RegisterContext::GetFlags
uint64_t GetFlags(uint64_t fail_value=0)
Definition: RegisterContext.cpp:182
fp
@ fp
Definition: CompactUnwindInfo.cpp:1247
lldb_private::RegisterContext::CopyFromRegisterContext
bool CopyFromRegisterContext(lldb::RegisterContextSP context)
Definition: RegisterContext.cpp:221
lldb
Definition: SBAddress.h:15
Endian.h
RegisterContext.h
Value.h
ExecutionContext.h
lldb_private::RegisterContext::GetRegisterInfoByName
const RegisterInfo * GetRegisterInfoByName(llvm::StringRef reg_name, uint32_t start_idx=0)
Definition: RegisterContext.cpp:52
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:138
LLDB_REGNUM_GENERIC_RA
#define LLDB_REGNUM_GENERIC_RA
Definition: lldb-defines.h:66