LLDB mainline
ABISysV_arc.cpp
Go to the documentation of this file.
1//===-- ABISysV_arc.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#include "ABISysV_arc.h"
10
11// C Includes
12// C++ Includes
13#include <array>
14#include <limits>
15#include <type_traits>
16
17// Other libraries and framework includes
18#include "llvm/IR/DerivedTypes.h"
19#include "llvm/Support/MathExtras.h"
20#include "llvm/TargetParser/Triple.h"
21
22#include "lldb/Core/Module.h"
24#include "lldb/Core/Value.h"
26#include "lldb/Target/Process.h"
29#include "lldb/Target/Target.h"
30#include "lldb/Target/Thread.h"
33#include "lldb/Utility/Status.h"
37
38#define DEFINE_REG_NAME(reg_num) ConstString(#reg_num).GetCString()
39#define DEFINE_REG_NAME_STR(reg_name) ConstString(reg_name).GetCString()
40
41// The ABI is not a source of such information as size, offset, encoding, etc.
42// of a register. Just provides correct dwarf and eh_frame numbers.
43
44#define DEFINE_GENERIC_REGISTER_STUB(dwarf_num, str_name, generic_num) \
45 { \
46 DEFINE_REG_NAME(dwarf_num), DEFINE_REG_NAME_STR(str_name), \
47 0, 0, eEncodingInvalid, eFormatDefault, \
48 { dwarf_num, dwarf_num, generic_num, LLDB_INVALID_REGNUM, dwarf_num }, \
49 nullptr, nullptr, nullptr, \
50 }
51
52#define DEFINE_REGISTER_STUB(dwarf_num, str_name) \
53 DEFINE_GENERIC_REGISTER_STUB(dwarf_num, str_name, LLDB_INVALID_REGNUM)
54
55using namespace lldb;
56using namespace lldb_private;
57
59
60namespace {
61namespace dwarf {
62enum regnums {
63 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16,
64 r17, r18, r19, r20, r21, r22, r23, r24, r25, r26,
65 r27, fp = r27, r28, sp = r28, r29, r30, r31, blink = r31,
66 r32, r33, r34, r35, r36, r37, r38, r39, r40, r41, r42, r43, r44, r45, r46,
67 r47, r48, r49, r50, r51, r52, r53, r54, r55, r56, r57, r58, r59, r60,
68 /*reserved,*/ /*limm indicator,*/ r63 = 63, pc = 70, status32 = 74
69};
70
71static const std::array<RegisterInfo, 64> g_register_infos = { {
80 DEFINE_REGISTER_STUB(r8, nullptr),
81 DEFINE_REGISTER_STUB(r9, nullptr),
82 DEFINE_REGISTER_STUB(r10, nullptr),
83 DEFINE_REGISTER_STUB(r11, nullptr),
84 DEFINE_REGISTER_STUB(r12, nullptr),
85 DEFINE_REGISTER_STUB(r13, nullptr),
86 DEFINE_REGISTER_STUB(r14, nullptr),
87 DEFINE_REGISTER_STUB(r15, nullptr),
88 DEFINE_REGISTER_STUB(r16, nullptr),
89 DEFINE_REGISTER_STUB(r17, nullptr),
90 DEFINE_REGISTER_STUB(r18, nullptr),
91 DEFINE_REGISTER_STUB(r19, nullptr),
92 DEFINE_REGISTER_STUB(r20, nullptr),
93 DEFINE_REGISTER_STUB(r21, nullptr),
94 DEFINE_REGISTER_STUB(r22, nullptr),
95 DEFINE_REGISTER_STUB(r23, nullptr),
96 DEFINE_REGISTER_STUB(r24, nullptr),
97 DEFINE_REGISTER_STUB(r25, nullptr),
98 DEFINE_REGISTER_STUB(r26, "gp"),
101 DEFINE_REGISTER_STUB(r29, "ilink"),
102 DEFINE_REGISTER_STUB(r30, nullptr),
104 DEFINE_REGISTER_STUB(r32, nullptr),
105 DEFINE_REGISTER_STUB(r33, nullptr),
106 DEFINE_REGISTER_STUB(r34, nullptr),
107 DEFINE_REGISTER_STUB(r35, nullptr),
108 DEFINE_REGISTER_STUB(r36, nullptr),
109 DEFINE_REGISTER_STUB(r37, nullptr),
110 DEFINE_REGISTER_STUB(r38, nullptr),
111 DEFINE_REGISTER_STUB(r39, nullptr),
112 DEFINE_REGISTER_STUB(r40, nullptr),
113 DEFINE_REGISTER_STUB(r41, nullptr),
114 DEFINE_REGISTER_STUB(r42, nullptr),
115 DEFINE_REGISTER_STUB(r43, nullptr),
116 DEFINE_REGISTER_STUB(r44, nullptr),
117 DEFINE_REGISTER_STUB(r45, nullptr),
118 DEFINE_REGISTER_STUB(r46, nullptr),
119 DEFINE_REGISTER_STUB(r47, nullptr),
120 DEFINE_REGISTER_STUB(r48, nullptr),
121 DEFINE_REGISTER_STUB(r49, nullptr),
122 DEFINE_REGISTER_STUB(r50, nullptr),
123 DEFINE_REGISTER_STUB(r51, nullptr),
124 DEFINE_REGISTER_STUB(r52, nullptr),
125 DEFINE_REGISTER_STUB(r53, nullptr),
126 DEFINE_REGISTER_STUB(r54, nullptr),
127 DEFINE_REGISTER_STUB(r55, nullptr),
128 DEFINE_REGISTER_STUB(r56, nullptr),
129 DEFINE_REGISTER_STUB(r57, nullptr),
130 DEFINE_REGISTER_STUB(r58, "accl"),
131 DEFINE_REGISTER_STUB(r59, "acch"),
132 DEFINE_REGISTER_STUB(r60, "lp_count"),
133 DEFINE_REGISTER_STUB(r63, "pcl"),
136} // namespace dwarf
137} // namespace
138
140 count = dwarf::g_register_infos.size();
141 return dwarf::g_register_infos.data();
142}
143
144size_t ABISysV_arc::GetRedZoneSize() const { return 0; }
145
148 const auto *const rf_build_reg = reg_ctx.GetRegisterInfoByName("rf_build");
149
150 const auto reg_value = reg_ctx.ReadRegisterAsUnsigned(rf_build_reg,
151 /*fail_value*/ 0);
152 // RF_BUILD "Number of Entries" bit.
153 const uint32_t rf_entries_bit = 1U << 9U;
154 m_is_reg_file_reduced = (reg_value & rf_entries_bit) != 0;
155 }
156
157 return m_is_reg_file_reduced.value_or(false);
158}
159
160//------------------------------------------------------------------
161// Static Functions
162//------------------------------------------------------------------
163
165 return llvm::Triple::arc == arch.GetTriple().getArch() ?
166 ABISP(new ABISysV_arc(std::move(process_sp), MakeMCRegisterInfo(arch))) :
167 ABISP();
168}
169
170static const size_t word_size = 4U;
171static const size_t reg_size = word_size;
172
173static inline size_t AugmentArgSize(size_t size_in_bytes) {
174 return llvm::alignTo(size_in_bytes, word_size);
175}
176
177static size_t
178TotalArgsSizeInWords(const llvm::ArrayRef<ABI::CallArgument> &args) {
179 size_t total_size = 0;
180 for (const auto &arg : args)
181 total_size +=
182 (ABI::CallArgument::TargetValue == arg.type ? AugmentArgSize(arg.size)
183 : reg_size) /
184 word_size;
185
186 return total_size;
187}
188
190 addr_t func_addr, addr_t return_addr,
191 llvm::ArrayRef<addr_t> args) const {
192 // We don't use the traditional trivial call specialized for jit.
193 return false;
194}
195
197 addr_t ra, llvm::Type &prototype,
198 llvm::ArrayRef<ABI::CallArgument> args) const {
199 auto reg_ctx = thread.GetRegisterContext();
200 if (!reg_ctx)
201 return false;
202
203 uint32_t pc_reg = reg_ctx->ConvertRegisterKindToRegisterNumber(
205 if (pc_reg == LLDB_INVALID_REGNUM)
206 return false;
207
208 uint32_t ra_reg = reg_ctx->ConvertRegisterKindToRegisterNumber(
210 if (ra_reg == LLDB_INVALID_REGNUM)
211 return false;
212
213 uint32_t sp_reg = reg_ctx->ConvertRegisterKindToRegisterNumber(
215 if (sp_reg == LLDB_INVALID_REGNUM)
216 return false;
217
219 ProcessSP process = thread.GetProcess();
220 if (!process)
221 return false;
222
223 // Push host data onto target.
224 for (const auto &arg : args) {
225 // Skip over target values.
226 if (arg.type == ABI::CallArgument::TargetValue)
227 continue;
228
229 // Create space on the stack for this data 4-byte aligned.
230 sp -= AugmentArgSize(arg.size);
231
232 if (process->WriteMemory(sp, arg.data_up.get(), arg.size, error) < arg.size
233 || error.Fail())
234 return false;
235
236 // Update the argument with the target pointer.
237 *const_cast<addr_t *>(&arg.value) = sp;
238 }
239
240 // Make sure number of parameters matches prototype.
241 assert(!prototype.isFunctionVarArg());
242 assert(prototype.getFunctionNumParams() == args.size());
243
244 const size_t regs_for_args_count = IsRegisterFileReduced(*reg_ctx) ? 4U : 8U;
245
246 // Number of arguments passed on stack.
247 auto args_size = TotalArgsSizeInWords(args);
248 auto on_stack =
249 args_size <= regs_for_args_count ? 0 : args_size - regs_for_args_count;
250 auto offset = on_stack * word_size;
251
252 uint8_t reg_value[reg_size];
253 size_t reg_index = LLDB_REGNUM_GENERIC_ARG1;
254
255 for (const auto &arg : args) {
256 auto value = reinterpret_cast<const uint8_t *>(&arg.value);
257 auto size =
258 ABI::CallArgument::TargetValue == arg.type ? arg.size : reg_size;
259
260 // Pass arguments via registers.
261 while (size > 0 && reg_index < regs_for_args_count) {
262 size_t byte_index = 0;
263 auto end = size < reg_size ? size : reg_size;
264
265 while (byte_index < end) {
266 reg_value[byte_index++] = *(value++);
267 --size;
268 }
269
270 while (byte_index < reg_size) {
271 reg_value[byte_index++] = 0;
272 }
273
274 RegisterValue reg_val_obj(llvm::ArrayRef(reg_value, reg_size),
276 if (!reg_ctx->WriteRegister(
277 reg_ctx->GetRegisterInfo(eRegisterKindGeneric, reg_index),
278 reg_val_obj))
279 return false;
280
281 // NOTE: It's unsafe to iterate through LLDB_REGNUM_GENERICs.
282 ++reg_index;
283 }
284
285 if (reg_index < regs_for_args_count || size == 0)
286 continue;
287
288 // Remaining arguments are passed on the stack.
289 if (process->WriteMemory(sp - offset, value, size, error) < size ||
290 !error.Success())
291 return false;
292
293 offset -= AugmentArgSize(size);
294 }
295
296 // Set stack pointer immediately below arguments.
297 sp -= on_stack * word_size;
298
299 // Update registers with current function call state.
300 reg_ctx->WriteRegisterFromUnsigned(pc_reg, pc);
301 reg_ctx->WriteRegisterFromUnsigned(ra_reg, ra);
302 reg_ctx->WriteRegisterFromUnsigned(sp_reg, sp);
303
304 return true;
305}
306
307bool ABISysV_arc::GetArgumentValues(Thread &thread, ValueList &values) const {
308 return false;
309}
310
312 ValueObjectSP &new_value_sp) {
313 Status result;
314 if (!new_value_sp) {
315 result = Status::FromErrorString("Empty value object for return value.");
316 return result;
317 }
318
319 CompilerType compiler_type = new_value_sp->GetCompilerType();
320 if (!compiler_type) {
321 result = Status::FromErrorString("Null clang type for return value.");
322 return result;
323 }
324
325 auto &reg_ctx = *frame_sp->GetThread()->GetRegisterContext();
326
327 bool is_signed = false;
328 if (!compiler_type.IsIntegerOrEnumerationType(is_signed) &&
329 !compiler_type.IsPointerType()) {
331 "We don't support returning other types at present");
332 return result;
333 }
334
335 DataExtractor data;
336 size_t num_bytes = new_value_sp->GetData(data, result);
337
338 if (result.Fail()) {
340 "Couldn't convert return value to raw data: %s", result.AsCString());
341 return result;
342 }
343
344 if (num_bytes <= 2 * reg_size) {
345 offset_t offset = 0;
346 uint64_t raw_value = data.GetMaxU64(&offset, num_bytes);
347
348 auto reg_info =
349 reg_ctx.GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG1);
350 if (!reg_ctx.WriteRegisterFromUnsigned(reg_info, raw_value)) {
352 "Couldn't write value to register %s", reg_info->name);
353 return result;
354 }
355
356 if (num_bytes <= reg_size)
357 return result; // Successfully written.
358
359 raw_value >>= 32;
360 reg_info =
361 reg_ctx.GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG2);
362 if (!reg_ctx.WriteRegisterFromUnsigned(reg_info, raw_value)) {
364 "Couldn't write value to register %s", reg_info->name);
365 }
366
367 return result;
368 }
369
371 "We don't support returning large integer values at present.");
372 return result;
373}
374
375template <typename T>
376static void SetInteger(Scalar &scalar, uint64_t raw_value, bool is_signed) {
377 raw_value &= std::numeric_limits<T>::max();
378 if (is_signed)
379 scalar = static_cast<typename std::make_signed<T>::type>(raw_value);
380 else
381 scalar = static_cast<T>(raw_value);
382}
383
384static bool SetSizedInteger(Scalar &scalar, uint64_t raw_value,
385 uint8_t size_in_bytes, bool is_signed) {
386 switch (size_in_bytes) {
387 default:
388 return false;
389
390 case sizeof(uint64_t):
391 SetInteger<uint64_t>(scalar, raw_value, is_signed);
392 break;
393
394 case sizeof(uint32_t):
395 SetInteger<uint32_t>(scalar, raw_value, is_signed);
396 break;
397
398 case sizeof(uint16_t):
399 SetInteger<uint16_t>(scalar, raw_value, is_signed);
400 break;
401
402 case sizeof(uint8_t):
403 SetInteger<uint8_t>(scalar, raw_value, is_signed);
404 break;
405 }
406
407 return true;
408}
409
410static bool SetSizedFloat(Scalar &scalar, uint64_t raw_value,
411 uint8_t size_in_bytes) {
412 switch (size_in_bytes) {
413 default:
414 return false;
415
416 case sizeof(uint64_t):
417 scalar = *reinterpret_cast<double *>(&raw_value);
418 break;
419
420 case sizeof(uint32_t):
421 scalar = *reinterpret_cast<float *>(&raw_value);
422 break;
423 }
424
425 return true;
426}
427
428static uint64_t ReadRawValue(const RegisterContextSP &reg_ctx,
429 uint8_t size_in_bytes) {
430 auto reg_info_r0 =
431 reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG1);
432
433 // Extract the register context so we can read arguments from registers.
434 uint64_t raw_value =
435 reg_ctx->ReadRegisterAsUnsigned(reg_info_r0, 0) & UINT32_MAX;
436
437 if (sizeof(uint64_t) == size_in_bytes)
438 raw_value |= (reg_ctx->ReadRegisterAsUnsigned(
439 reg_ctx->GetRegisterInfo(eRegisterKindGeneric,
441 UINT64_MAX) << 32U;
442
443 return raw_value;
444}
445
448 CompilerType &compiler_type) const {
449 if (!compiler_type)
450 return ValueObjectSP();
451
452 auto reg_ctx = thread.GetRegisterContext();
453 if (!reg_ctx)
454 return ValueObjectSP();
455
456 Value value;
457 value.SetCompilerType(compiler_type);
458
459 const uint32_t type_flags = compiler_type.GetTypeInfo();
460 // Integer return type.
461 if (type_flags & eTypeIsInteger) {
462 const size_t byte_size = compiler_type.GetByteSize(&thread).value_or(0);
463 auto raw_value = ReadRawValue(reg_ctx, byte_size);
464
465 const bool is_signed = (type_flags & eTypeIsSigned) != 0;
466 if (!SetSizedInteger(value.GetScalar(), raw_value, byte_size, is_signed))
467 return ValueObjectSP();
468
469 value.SetValueType(Value::ValueType::Scalar);
470 }
471 // Pointer return type.
472 else if (type_flags & eTypeIsPointer) {
473 auto reg_info_r0 = reg_ctx->GetRegisterInfo(eRegisterKindGeneric,
475 value.GetScalar() = reg_ctx->ReadRegisterAsUnsigned(reg_info_r0, 0);
476
477 value.SetValueType(Value::ValueType::Scalar);
478 }
479 // Floating point return type.
480 else if (type_flags & eTypeIsFloat) {
481 uint32_t float_count = 0;
482 bool is_complex = false;
483
484 if (compiler_type.IsFloatingPointType(float_count, is_complex) &&
485 1 == float_count && !is_complex) {
486 const size_t byte_size = compiler_type.GetByteSize(&thread).value_or(0);
487 auto raw_value = ReadRawValue(reg_ctx, byte_size);
488
489 if (!SetSizedFloat(value.GetScalar(), raw_value, byte_size))
490 return ValueObjectSP();
491 }
492 }
493 // Unsupported return type.
494 else
495 return ValueObjectSP();
496
498 value, ConstString(""));
499}
500
502 Thread &thread, CompilerType &return_compiler_type) const {
503 ValueObjectSP return_valobj_sp;
504
505 if (!return_compiler_type)
506 return return_valobj_sp;
507
508 ExecutionContext exe_ctx(thread.shared_from_this());
509 return GetReturnValueObjectSimple(thread, return_compiler_type);
510}
511
513 llvm::Type &retType) const {
514 auto reg_ctx = thread.GetRegisterContext();
515 if (!reg_ctx)
516 return ValueObjectSP();
517
518 Value value;
519 // Void return type.
520 if (retType.isVoidTy()) {
521 value.GetScalar() = 0;
522 }
523 // Integer return type.
524 else if (retType.isIntegerTy()) {
525 size_t byte_size = retType.getPrimitiveSizeInBits();
526 if (1 != byte_size) // For boolean type.
527 byte_size /= CHAR_BIT;
528
529 auto raw_value = ReadRawValue(reg_ctx, byte_size);
530
531 const bool is_signed = false; // IR Type doesn't provide this info.
532 if (!SetSizedInteger(value.GetScalar(), raw_value, byte_size, is_signed))
533 return ValueObjectSP();
534 }
535 // Pointer return type.
536 else if (retType.isPointerTy()) {
537 auto reg_info_r0 = reg_ctx->GetRegisterInfo(eRegisterKindGeneric,
539 value.GetScalar() = reg_ctx->ReadRegisterAsUnsigned(reg_info_r0, 0);
540 value.SetValueType(Value::ValueType::Scalar);
541 }
542 // Floating point return type.
543 else if (retType.isFloatingPointTy()) {
544 const size_t byte_size = retType.getPrimitiveSizeInBits() / CHAR_BIT;
545 auto raw_value = ReadRawValue(reg_ctx, byte_size);
546
547 if (!SetSizedFloat(value.GetScalar(), raw_value, byte_size))
548 return ValueObjectSP();
549 }
550 // Unsupported return type.
551 else
552 return ValueObjectSP();
553
555 value, ConstString(""));
556}
557
559 unwind_plan.Clear();
561
563
564 // Our Call Frame Address is the stack pointer value.
565 row->GetCFAValue().SetIsRegisterPlusOffset(dwarf::sp, 0);
566
567 // The previous PC is in the BLINK.
568 row->SetRegisterLocationToRegister(dwarf::pc, dwarf::blink, true);
569 unwind_plan.AppendRow(row);
570
571 // All other registers are the same.
572 unwind_plan.SetSourceName("arc at-func-entry default");
574
575 return true;
576}
577
579 return false;
580}
581
583 if (nullptr == reg_info)
584 return false;
585
586 // Volatile registers are: r0..r12.
587 uint32_t regnum = reg_info->kinds[eRegisterKindDWARF];
588 if (regnum <= 12)
589 return true;
590
591 static const std::string ra_reg_name = "blink";
592 return ra_reg_name == reg_info->name;
593}
594
597 "System V ABI for ARC targets", CreateInstance);
598}
599
602}
static const RegisterInfo g_register_infos[]
#define DEFINE_REGISTER_STUB(dwarf_num, str_name)
Definition: ABISysV_arc.cpp:52
static void SetInteger(Scalar &scalar, uint64_t raw_value, bool is_signed)
static bool SetSizedInteger(Scalar &scalar, uint64_t raw_value, uint8_t size_in_bytes, bool is_signed)
static const size_t word_size
static size_t TotalArgsSizeInWords(const llvm::ArrayRef< ABI::CallArgument > &args)
#define DEFINE_GENERIC_REGISTER_STUB(dwarf_num, str_name, generic_num)
Definition: ABISysV_arc.cpp:44
static const size_t reg_size
static bool SetSizedFloat(Scalar &scalar, uint64_t raw_value, uint8_t size_in_bytes)
static uint64_t ReadRawValue(const RegisterContextSP &reg_ctx, uint8_t size_in_bytes)
static size_t AugmentArgSize(size_t size_in_bytes)
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_PLUGIN_DEFINE_ADV(ClassName, PluginName)
Definition: PluginManager.h:26
lldb::ValueObjectSP GetReturnValueObjectSimple(lldb_private::Thread &thread, lldb_private::CompilerType &ast_type) const
bool GetArgumentValues(lldb_private::Thread &thread, lldb_private::ValueList &values) const override
RegisterFileFlag m_is_reg_file_reduced
Definition: ABISysV_arc.h:101
bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override
const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch)
static void Initialize()
bool CreateFunctionEntryUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
bool PrepareTrivialCall(lldb_private::Thread &thread, lldb::addr_t sp, lldb::addr_t functionAddress, lldb::addr_t returnAddress, llvm::ArrayRef< lldb::addr_t > args) const override
lldb_private::Status SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value) override
size_t GetRedZoneSize() const override
bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread, lldb_private::CompilerType &type) const override
static llvm::StringRef GetPluginNameStatic()
Definition: ABISysV_arc.h:83
bool IsRegisterFileReduced(lldb_private::RegisterContext &reg_ctx) const
static void Terminate()
static std::unique_ptr< llvm::MCRegisterInfo > MakeMCRegisterInfo(const ArchSpec &arch)
Utility function to construct a MCRegisterInfo using the ArchSpec triple.
Definition: ABI.cpp:234
An architecture specification class.
Definition: ArchSpec.h:31
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:461
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
bool IsFloatingPointType(uint32_t &count, bool &is_complex) const
bool IsIntegerOrEnumerationType(bool &is_signed) const
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
bool IsPointerType(CompilerType *pointee_type=nullptr) const
A uniqued constant string class.
Definition: ConstString.h:40
An data extractor class.
Definition: DataExtractor.h:48
const void * GetData(lldb::offset_t *offset_ptr, lldb::offset_t length) const
Extract length bytes from *offset_ptr.
uint64_t GetMaxU64(lldb::offset_t *offset_ptr, size_t byte_size) const
Extract an unsigned integer of size byte_size from *offset_ptr.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
uint64_t ReadRegisterAsUnsigned(uint32_t reg, uint64_t fail_value)
const RegisterInfo * GetRegisterInfoByName(llvm::StringRef reg_name, uint32_t start_idx=0)
An error handling class.
Definition: Status.h:115
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Definition: Status.cpp:106
static Status FromErrorString(const char *str)
Definition: Status.h:138
bool Fail() const
Test for error condition.
Definition: Status.cpp:270
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
Definition: Status.cpp:195
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
Definition: Thread.h:408
virtual lldb::RegisterContextSP GetRegisterContext()=0
lldb::ProcessSP GetProcess() const
Definition: Thread.h:157
void SetRegisterKind(lldb::RegisterKind kind)
Definition: UnwindPlan.h:471
void AppendRow(const RowSP &row_sp)
Definition: UnwindPlan.cpp:392
std::shared_ptr< Row > RowSP
Definition: UnwindPlan.h:429
void SetSourcedFromCompiler(lldb_private::LazyBool from_compiler)
Definition: UnwindPlan.h:512
void SetSourceName(const char *)
Definition: UnwindPlan.cpp:594
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS)
const Scalar & GetScalar() const
Definition: Value.h:112
void SetCompilerType(const CompilerType &compiler_type)
Definition: Value.cpp:268
void SetValueType(ValueType value_type)
Definition: Value.h:89
#define LLDB_REGNUM_GENERIC_RA
Definition: lldb-defines.h:59
#define LLDB_REGNUM_GENERIC_ARG8
Definition: lldb-defines.h:75
#define UINT64_MAX
Definition: lldb-defines.h:23
#define LLDB_REGNUM_GENERIC_ARG6
Definition: lldb-defines.h:71
#define LLDB_REGNUM_GENERIC_SP
Definition: lldb-defines.h:57
#define LLDB_REGNUM_GENERIC_ARG4
Definition: lldb-defines.h:67
#define LLDB_REGNUM_GENERIC_ARG3
Definition: lldb-defines.h:65
#define LLDB_REGNUM_GENERIC_ARG1
Definition: lldb-defines.h:61
#define LLDB_REGNUM_GENERIC_ARG7
Definition: lldb-defines.h:73
#define LLDB_REGNUM_GENERIC_FLAGS
Definition: lldb-defines.h:60
#define UINT32_MAX
Definition: lldb-defines.h:19
#define LLDB_INVALID_REGNUM
Definition: lldb-defines.h:87
#define LLDB_REGNUM_GENERIC_ARG2
Definition: lldb-defines.h:63
#define LLDB_REGNUM_GENERIC_PC
Definition: lldb-defines.h:56
#define LLDB_REGNUM_GENERIC_FP
Definition: lldb-defines.h:58
#define LLDB_REGNUM_GENERIC_ARG5
Definition: lldb-defines.h:69
A class that represents a running process on the host machine.
Definition: SBAddress.h:15
std::shared_ptr< lldb_private::ABI > ABISP
Definition: lldb-forward.h:317
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
Definition: lldb-forward.h:424
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Definition: lldb-forward.h:484
uint64_t offset_t
Definition: lldb-types.h:85
std::shared_ptr< lldb_private::Process > ProcessSP
Definition: lldb-forward.h:389
@ eByteOrderLittle
uint64_t addr_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
Definition: lldb-forward.h:394
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
@ eRegisterKindDWARF
the register numbers seen DWARF
Every register is described in detail including its name, alternate name (optional),...
uint32_t kinds[lldb::kNumRegisterKinds]
Holds all of the various register numbers for all register kinds.
llvm::ArrayRef< uint8_t > data(const uint8_t *context_base) const
const char * name
Name of this register, can't be NULL.