33#include "llvm/IR/Constants.h"
34#include "llvm/IR/DataLayout.h"
35#include "llvm/IR/Function.h"
36#include "llvm/IR/Instructions.h"
37#include "llvm/IR/Intrinsics.h"
38#include "llvm/IR/LLVMContext.h"
39#include "llvm/IR/Module.h"
40#include "llvm/IR/Operator.h"
41#include "llvm/Support/raw_ostream.h"
48static std::string
PrintValue(
const Value *value,
bool truncate =
false) {
50 raw_string_ostream rso(s);
53 s.resize(s.length() - 1);
56 while ((offset = s.find(
'\n')) != s.npos)
58 while (s[0] ==
' ' || s[0] ==
'\t')
64static std::string
PrintType(
const Type *type,
bool truncate =
false) {
66 raw_string_ostream rso(s);
69 s.resize(s.length() - 1);
74 const llvm::Function *called_function = call->getCalledFunction();
79 if (called_function->isIntrinsic()) {
80 switch (called_function->getIntrinsicID()) {
83 case llvm::Intrinsic::dbg_declare:
84 case llvm::Intrinsic::dbg_value:
94 typedef std::map<const Value *, lldb::addr_t>
ValueMap;
99 const BasicBlock *
m_bb =
nullptr;
101 BasicBlock::const_iterator
m_ii;
102 BasicBlock::const_iterator
m_ie;
127 void Jump(
const BasicBlock *bb) {
139 ValueMap::iterator i =
m_values.find(value);
144 ss.
Printf(
" 0x%llx", (
unsigned long long)addr);
158 type_size = PowerOf2Ceil(type_size);
160 scalar = value.zextOrTrunc(type_size * 8);
166 const Constant *constant = dyn_cast<Constant>(value);
169 if (constant->getValueID() == Value::ConstantFPVal) {
170 if (
auto *cfp = dyn_cast<ConstantFP>(constant)) {
171 if (cfp->getType()->isDoubleTy())
172 scalar = cfp->getValueAPF().convertToDouble();
173 else if (cfp->getType()->isFloatTy())
174 scalar = cfp->getValueAPF().convertToFloat();
190 size_t value_size =
m_target_data.getTypeStoreSize(value->getType());
196 value_size, extract_error);
202 if (value_size <= 8) {
203 Type *ty = value->getType();
204 if (ty->isDoubleTy()) {
205 scalar = value_extractor.
GetDouble(&offset);
207 }
else if (ty->isFloatTy()) {
208 scalar = value_extractor.
GetFloat(&offset);
211 uint64_t u64value = value_extractor.
GetMaxU64(&offset, value_size);
228 Type *vty = value->getType();
229 if (vty->isFloatTy() || vty->isDoubleTy()) {
230 cast_scalar = scalar;
238 size_t value_byte_size =
m_target_data.getTypeStoreSize(value->getType());
257 switch (constant->getValueID()) {
260 case Value::FunctionVal:
261 if (
const Function *constant_func = dyn_cast<Function>(constant)) {
263 bool missing_weak =
false;
271 case Value::ConstantIntVal:
272 if (
const ConstantInt *constant_int = dyn_cast<ConstantInt>(constant)) {
273 value = constant_int->getValue();
277 case Value::ConstantFPVal:
278 if (
const ConstantFP *constant_fp = dyn_cast<ConstantFP>(constant)) {
279 value = constant_fp->getValueAPF().bitcastToAPInt();
283 case Value::ConstantExprVal:
284 if (
const ConstantExpr *constant_expr =
285 dyn_cast<ConstantExpr>(constant)) {
286 switch (constant_expr->getOpcode()) {
289 case Instruction::IntToPtr:
290 case Instruction::PtrToInt:
291 case Instruction::BitCast:
293 case Instruction::GetElementPtr: {
294 ConstantExpr::const_op_iterator op_cursor = constant_expr->op_begin();
295 ConstantExpr::const_op_iterator op_end = constant_expr->op_end();
297 Constant *base = dyn_cast<Constant>(*op_cursor);
307 if (op_cursor == op_end)
310 SmallVector<Value *, 8> indices(op_cursor, op_end);
312 cast<GEPOperator>(constant_expr)->getSourceElementType();
319 const bool is_signed =
true;
320 value += APInt(value.getBitWidth(), offset, is_signed);
327 case Value::ConstantPointerNullVal:
328 if (isa<ConstantPointerNull>(constant)) {
358 LLDB_LOGF(log,
"Made an allocation for argument %s",
360 LLDB_LOGF(log,
" Data region : %llx", (
unsigned long long)address);
362 (
unsigned long long)data_address);
369 APInt resolved_value;
374 size_t constant_size =
m_target_data.getTypeStoreSize(constant->getType());
380 resolved_value.zextOrTrunc(llvm::NextPowerOf2(constant_size) * 8));
397 ret -= (ret % byte_alignment);
423 return std::string(
"<couldn't read data>");
427 for (
size_t i = 0; i < length; i++) {
428 if ((!(i & 0xf)) && i)
438 ValueMap::iterator i =
m_values.find(value);
447 if (
const Constant *constant = dyn_cast<Constant>(value)) {
461 "Interpreter doesn't handle one of the expression's opcodes";
463 "Interpreter doesn't handle one of the expression's operands";
465 "Interpreter encountered an internal error";
467 "Interrupted while interpreting expression";
469 "Interpreter couldn't resolve a value during execution";
471 "Interpreter couldn't allocate memory";
475 "Reached timeout while interpreting expression";
477 "Interpreter doesn't handle modules with multiple function bodies.";
480 switch (constant->getValueID()) {
483 case Value::ConstantIntVal:
484 case Value::ConstantFPVal:
485 case Value::FunctionVal:
487 case Value::ConstantExprVal:
488 if (
const ConstantExpr *constant_expr = dyn_cast<ConstantExpr>(constant)) {
489 switch (constant_expr->getOpcode()) {
492 case Instruction::IntToPtr:
493 case Instruction::PtrToInt:
494 case Instruction::BitCast:
496 case Instruction::GetElementPtr: {
498 ConstantExpr::const_op_iterator op_cursor = constant_expr->op_begin();
499 Constant *base = dyn_cast<Constant>(*op_cursor);
504 for (Value *op : make_range(constant_expr->op_begin() + 1,
505 constant_expr->op_end())) {
506 ConstantInt *constant_int = dyn_cast<ConstantInt>(op);
516 case Value::ConstantPointerNullVal:
523 const bool support_function_calls) {
526 bool saw_function_with_body =
false;
527 for (Function &f : module) {
528 if (f.begin() != f.end()) {
529 if (saw_function_with_body) {
530 LLDB_LOGF(log,
"More than one function in the module has a body");
534 saw_function_with_body =
true;
535 LLDB_LOGF(log,
"Saw function with body: %s", f.getName().str().c_str());
539 for (BasicBlock &bb : function) {
540 for (Instruction &ii : bb) {
541 switch (ii.getOpcode()) {
547 case Instruction::Add:
548 case Instruction::Alloca:
549 case Instruction::BitCast:
550 case Instruction::Br:
551 case Instruction::PHI:
553 case Instruction::Call: {
554 CallInst *call_inst = dyn_cast<CallInst>(&ii);
563 LLDB_LOGF(log,
"Unsupported instruction: %s",
570 case Instruction::GetElementPtr:
572 case Instruction::FCmp:
573 case Instruction::ICmp: {
574 CmpInst *cmp_inst = dyn_cast<CmpInst>(&ii);
582 switch (cmp_inst->getPredicate()) {
584 LLDB_LOGF(log,
"Unsupported ICmp predicate: %s",
591 case CmpInst::FCMP_OEQ:
592 case CmpInst::ICMP_EQ:
593 case CmpInst::FCMP_UNE:
594 case CmpInst::ICMP_NE:
595 case CmpInst::FCMP_OGT:
596 case CmpInst::ICMP_UGT:
597 case CmpInst::FCMP_OGE:
598 case CmpInst::ICMP_UGE:
599 case CmpInst::FCMP_OLT:
600 case CmpInst::ICMP_ULT:
601 case CmpInst::FCMP_OLE:
602 case CmpInst::ICMP_ULE:
603 case CmpInst::ICMP_SGT:
604 case CmpInst::ICMP_SGE:
605 case CmpInst::ICMP_SLT:
606 case CmpInst::ICMP_SLE:
610 case Instruction::And:
611 case Instruction::AShr:
612 case Instruction::IntToPtr:
613 case Instruction::PtrToInt:
614 case Instruction::Load:
615 case Instruction::LShr:
616 case Instruction::Mul:
617 case Instruction::Or:
618 case Instruction::Ret:
619 case Instruction::SDiv:
620 case Instruction::SExt:
621 case Instruction::Shl:
622 case Instruction::SRem:
623 case Instruction::Store:
624 case Instruction::Sub:
625 case Instruction::Trunc:
626 case Instruction::UDiv:
627 case Instruction::URem:
628 case Instruction::Xor:
629 case Instruction::ZExt:
631 case Instruction::FAdd:
632 case Instruction::FSub:
633 case Instruction::FMul:
634 case Instruction::FDiv:
638 for (
unsigned oi = 0, oe = ii.getNumOperands(); oi != oe; ++oi) {
639 Value *operand = ii.getOperand(oi);
640 Type *operand_type = operand->getType();
642 switch (operand_type->getTypeID()) {
645 case Type::FixedVectorTyID:
646 case Type::ScalableVectorTyID: {
647 LLDB_LOGF(log,
"Unsupported operand type: %s",
659 if (operand_type->getPrimitiveSizeInBits() > 64) {
660 LLDB_LOGF(log,
"Unsupported operand type: %s",
667 if (Constant *constant = llvm::dyn_cast<Constant>(operand)) {
669 LLDB_LOGF(log,
"Unsupported constant: %s",
684 llvm::ArrayRef<lldb::addr_t> args,
695 raw_string_ostream oss(s);
697 module.print(oss,
nullptr);
699 LLDB_LOGF(log,
"Module as passed in to IRInterpreter::Interpret: \n\"%s\"",
703 const DataLayout &data_layout = module.getDataLayout();
715 for (llvm::Function::arg_iterator ai = function.arg_begin(),
716 ae = function.arg_end();
717 ai != ae; ++ai, ++arg_index) {
718 if (args.size() <=
static_cast<size_t>(arg_index)) {
720 "Not enough arguments passed in to function");
729 frame.
Jump(&function.front());
734 using clock = std::chrono::steady_clock;
737 std::optional<clock::time_point> end_time;
738 if (timeout && timeout->count() > 0)
739 end_time = clock::now() + *timeout;
743 if (end_time && clock::now() >= *end_time) {
751 "Interrupted in IR interpreting.")) {
757 const Instruction *inst = &*frame.
m_ii;
761 switch (inst->getOpcode()) {
765 case Instruction::Add:
766 case Instruction::Sub:
767 case Instruction::Mul:
768 case Instruction::SDiv:
769 case Instruction::UDiv:
770 case Instruction::SRem:
771 case Instruction::URem:
772 case Instruction::Shl:
773 case Instruction::LShr:
774 case Instruction::AShr:
775 case Instruction::And:
776 case Instruction::Or:
777 case Instruction::Xor:
778 case Instruction::FAdd:
779 case Instruction::FSub:
780 case Instruction::FMul:
781 case Instruction::FDiv: {
782 const BinaryOperator *bin_op = dyn_cast<BinaryOperator>(inst);
787 "getOpcode() returns %s, but instruction is not a BinaryOperator",
788 inst->getOpcodeName());
794 Value *lhs = inst->getOperand(0);
795 Value *rhs = inst->getOperand(1);
814 switch (inst->getOpcode()) {
817 case Instruction::Add:
818 case Instruction::FAdd:
821 case Instruction::Mul:
822 case Instruction::FMul:
825 case Instruction::Sub:
826 case Instruction::FSub:
829 case Instruction::SDiv:
834 case Instruction::UDiv:
839 case Instruction::FDiv:
842 case Instruction::SRem:
847 case Instruction::URem:
852 case Instruction::Shl:
855 case Instruction::AShr:
858 case Instruction::LShr:
862 case Instruction::And:
865 case Instruction::Or:
868 case Instruction::Xor:
876 LLDB_LOGF(log,
"Interpreted a %s", inst->getOpcodeName());
882 case Instruction::Alloca: {
883 const AllocaInst *alloca_inst = cast<AllocaInst>(inst);
885 if (alloca_inst->isArrayAllocation()) {
887 "AllocaInsts are not handled if isArrayAllocation() is true");
899 Type *T = alloca_inst->getAllocatedType();
900 Type *Tptr = alloca_inst->getType();
905 LLDB_LOGF(log,
"Couldn't allocate memory for an AllocaInst");
914 "Couldn't allocate the result pointer for an AllocaInst");
924 LLDB_LOGF(log,
"Couldn't write the result pointer for an AllocaInst");
927 execution_unit.
Free(P, free_error);
928 execution_unit.
Free(R, free_error);
935 LLDB_LOGF(log,
"Interpreted an AllocaInst");
940 case Instruction::BitCast:
941 case Instruction::ZExt: {
942 const CastInst *cast_inst = cast<CastInst>(inst);
944 Value *source = cast_inst->getOperand(0);
956 case Instruction::SExt: {
957 const CastInst *cast_inst = cast<CastInst>(inst);
959 Value *source = cast_inst->getOperand(0);
975 case Instruction::Br: {
976 const BranchInst *br_inst = cast<BranchInst>(inst);
978 if (br_inst->isConditional()) {
979 Value *condition = br_inst->getCondition();
990 frame.
Jump(br_inst->getSuccessor(0));
992 frame.
Jump(br_inst->getSuccessor(1));
995 LLDB_LOGF(log,
"Interpreted a BrInst with a condition");
1000 frame.
Jump(br_inst->getSuccessor(0));
1003 LLDB_LOGF(log,
"Interpreted a BrInst with no condition");
1008 case Instruction::PHI: {
1009 const PHINode *phi_inst = cast<PHINode>(inst);
1012 "Encountered PHI node without having jumped from another "
1019 Value *value = phi_inst->getIncomingValueForBlock(frame.
m_prev_bb);
1029 LLDB_LOGF(log,
"Interpreted a %s", inst->getOpcodeName());
1034 case Instruction::GetElementPtr: {
1035 const GetElementPtrInst *gep_inst = cast<GetElementPtrInst>(inst);
1037 const Value *pointer_operand = gep_inst->getPointerOperand();
1038 Type *src_elem_ty = gep_inst->getSourceElementType();
1049 typedef SmallVector<Value *, 8> IndexVector;
1050 typedef IndexVector::iterator IndexIterator;
1052 SmallVector<Value *, 8> indices(gep_inst->idx_begin(),
1053 gep_inst->idx_end());
1055 SmallVector<Value *, 8> const_indices;
1057 for (IndexIterator ii = indices.begin(), ie = indices.end(); ii != ie;
1059 ConstantInt *constant_index = dyn_cast<ConstantInt>(*ii);
1061 if (!constant_index) {
1070 LLDB_LOGF(log,
"Evaluated constant index %s as %llu",
1073 constant_index = cast<ConstantInt>(ConstantInt::get(
1077 const_indices.push_back(constant_index);
1081 data_layout.getIndexedOffsetInType(src_elem_ty, const_indices);
1088 LLDB_LOGF(log,
"Interpreted a GetElementPtrInst");
1094 case Instruction::FCmp:
1095 case Instruction::ICmp: {
1096 const CmpInst *icmp_inst = cast<CmpInst>(inst);
1098 CmpInst::Predicate predicate = icmp_inst->getPredicate();
1100 Value *lhs = inst->getOperand(0);
1101 Value *rhs = inst->getOperand(1);
1120 switch (predicate) {
1123 case CmpInst::ICMP_EQ:
1124 case CmpInst::FCMP_OEQ:
1127 case CmpInst::ICMP_NE:
1128 case CmpInst::FCMP_UNE:
1131 case CmpInst::ICMP_UGT:
1136 case CmpInst::ICMP_UGE:
1141 case CmpInst::FCMP_OGE:
1144 case CmpInst::FCMP_OGT:
1147 case CmpInst::ICMP_ULT:
1152 case CmpInst::FCMP_OLT:
1155 case CmpInst::ICMP_ULE:
1160 case CmpInst::FCMP_OLE:
1163 case CmpInst::ICMP_SGT:
1168 case CmpInst::ICMP_SGE:
1173 case CmpInst::ICMP_SLT:
1178 case CmpInst::ICMP_SLE:
1188 LLDB_LOGF(log,
"Interpreted an ICmpInst");
1194 case Instruction::IntToPtr: {
1195 const IntToPtrInst *int_to_ptr_inst = cast<IntToPtrInst>(inst);
1197 Value *src_operand = int_to_ptr_inst->getOperand(0);
1210 LLDB_LOGF(log,
"Interpreted an IntToPtr");
1215 case Instruction::PtrToInt: {
1216 const PtrToIntInst *ptr_to_int_inst = cast<PtrToIntInst>(inst);
1218 Value *src_operand = ptr_to_int_inst->getOperand(0);
1231 LLDB_LOGF(log,
"Interpreted a PtrToInt");
1236 case Instruction::Trunc: {
1237 const TruncInst *trunc_inst = cast<TruncInst>(inst);
1239 Value *src_operand = trunc_inst->getOperand(0);
1257 case Instruction::Load: {
1258 const LoadInst *load_inst = cast<LoadInst>(inst);
1266 const Value *pointer_operand = load_inst->getPointerOperand();
1272 LLDB_LOGF(log,
"LoadInst's value doesn't resolve to anything");
1278 LLDB_LOGF(log,
"LoadInst's pointer doesn't resolve to anything");
1288 LLDB_LOGF(log,
"Couldn't read the address to be loaded for a LoadInst");
1293 Type *target_ty = load_inst->getType();
1294 size_t target_size = data_layout.getTypeStoreSize(target_ty);
1301 LLDB_LOGF(log,
"Couldn't read from a region on behalf of a LoadInst");
1310 LLDB_LOGF(log,
"Couldn't write to a region on behalf of a LoadInst");
1316 LLDB_LOGF(log,
"Interpreted a LoadInst");
1322 case Instruction::Ret: {
1325 case Instruction::Store: {
1326 const StoreInst *store_inst = cast<StoreInst>(inst);
1334 const Value *value_operand = store_inst->getValueOperand();
1335 const Value *pointer_operand = store_inst->getPointerOperand();
1341 LLDB_LOGF(log,
"StoreInst's value doesn't resolve to anything");
1347 LLDB_LOGF(log,
"StoreInst's pointer doesn't resolve to anything");
1357 LLDB_LOGF(log,
"Couldn't read the address to be loaded for a LoadInst");
1362 Type *target_ty = value_operand->getType();
1363 size_t target_size = data_layout.getTypeStoreSize(target_ty);
1370 LLDB_LOGF(log,
"Couldn't read from a region on behalf of a StoreInst");
1379 LLDB_LOGF(log,
"Couldn't write to a region on behalf of a StoreInst");
1385 LLDB_LOGF(log,
"Interpreted a StoreInst");
1391 case Instruction::Call: {
1392 const CallInst *call_inst = cast<CallInst>(inst);
1398 llvm::Type *returnType = call_inst->getType();
1399 if (returnType ==
nullptr) {
1401 "unable to access return type");
1406 if (!returnType->isVoidTy() && !returnType->isIntegerTy() &&
1407 !returnType->isPointerTy()) {
1409 "return type is not supported");
1429 const llvm::Value *val = call_inst->getCalledOperand();
1433 "unable to get address of function");
1441 llvm::FunctionType *prototype = call_inst->getFunctionType();
1444 const int numArgs = call_inst->arg_size();
1448 if (numArgs >= 16) {
1450 "function takes too many arguments");
1456 for (
int i = 0; i < numArgs; i++) {
1458 llvm::Value *arg_op = call_inst->getArgOperand(i);
1459 llvm::Type *arg_ty = arg_op->getType();
1462 if (!arg_ty->isIntegerTy() && !arg_ty->isPointerTy()) {
1464 "argument %d must be integer type", i);
1472 "unable to evaluate argument %d", i);
1477 if (arg_ty->isPointerTy()) {
1479 size_t dataSize = 0;
1481 bool Success = execution_unit.
GetAllocSize(addr, dataSize);
1484 "unable to locate host data for transfer to device");
1486 rawArgs[i].
size = dataSize;
1487 rawArgs[i].
data_up.reset(
new uint8_t[dataSize + 1]);
1490 execution_unit.
ReadMemory(rawArgs[i].data_up.get(), addr, dataSize,
1492 assert(!
error.Fail() &&
1493 "we have failed to read the string from memory");
1496 rawArgs[i].
data_up[dataSize] =
'\0';
1502 rawArgs[i].
size = arg_ty->getIntegerBitWidth() / 8;
1509 llvm::ArrayRef<lldb_private::ABI::CallArgument> args(rawArgs, numArgs);
1514 exe_ctx.
GetThreadRef(), funcAddr, *prototype, *returnType, args,
1519 if (!call_plan_sp || !call_plan_sp->ValidatePlan(&ss)) {
1521 "unable to make ThreadPlanCallFunctionUsingABI for 0x%llx",
1530 process->
RunThreadPlan(exe_ctx, call_plan_sp, options, diagnostics);
1535 "ThreadPlanCallFunctionUsingABI failed");
1542 if (returnType->isVoidTy()) {
1546 if (returnType->isIntegerTy() || returnType->isPointerTy()) {
1554 if (vobj ==
nullptr || !retVal) {
1556 "unable to get the return value");
static llvm::raw_ostream & error(Stream &strm)
#define INTERRUPT_REQUESTED(debugger,...)
This handy define will keep you from having to generate a report for the interruption by hand.
static bool CanResolveConstant(llvm::Constant *constant)
static const char * memory_allocation_error
static const char * memory_read_error
static std::string PrintValue(const Value *value, bool truncate=false)
static const char * interpreter_internal_error
static std::string PrintType(const Type *type, bool truncate=false)
static const char * interrupt_error
static const char * unsupported_operand_error
static const char * timeout_error
static bool CanIgnoreCall(const CallInst *call)
static const char * memory_write_error
static const char * unsupported_opcode_error
static const char * bad_value_error
static const char * too_many_functions_error
#define LLDB_LOGF(log,...)
static bool CanInterpret(llvm::Module &module, llvm::Function &function, lldb_private::Status &error, const bool support_function_calls)
static bool Interpret(llvm::Module &module, llvm::Function &function, llvm::ArrayRef< lldb::addr_t > args, lldb_private::IRExecutionUnit &execution_unit, lldb_private::Status &error, lldb::addr_t stack_frame_bottom, lldb::addr_t stack_frame_top, lldb_private::ExecutionContext &exe_ctx, lldb_private::Timeout< std::micro > timeout)
lldb::addr_t ResolveValue(const Value *value, Module &module)
lldb::addr_t m_stack_pointer
std::string SummarizeValue(const Value *value)
bool ResolveConstantValue(APInt &value, const Constant *constant)
bool ResolveConstant(lldb::addr_t process_address, const Constant *constant)
const DataLayout & m_target_data
lldb_private::IRExecutionUnit & m_execution_unit
bool MakeArgument(const Argument *value, uint64_t address)
lldb::addr_t Malloc(size_t size, uint8_t byte_alignment)
const BasicBlock * m_prev_bb
BasicBlock::const_iterator m_ie
lldb::addr_t Malloc(llvm::Type *type)
bool AssignToMatchType(lldb_private::Scalar &scalar, llvm::APInt value, Type *type)
~InterpreterStackFrame()=default
InterpreterStackFrame(const DataLayout &target_data, lldb_private::IRExecutionUnit &execution_unit, lldb::addr_t stack_frame_bottom, lldb::addr_t stack_frame_top)
void Jump(const BasicBlock *bb)
std::string PrintData(lldb::addr_t addr, llvm::Type *type)
std::map< const Value *, lldb::addr_t > ValueMap
BasicBlock::const_iterator m_ii
lldb::ByteOrder m_byte_order
bool EvaluateValue(lldb_private::Scalar &scalar, const Value *value, Module &module)
bool AssignValue(const Value *value, lldb_private::Scalar scalar, Module &module)
lldb::addr_t m_frame_process_address
A section + offset based address class.
A uniqued constant string class.
A subclass of DataBuffer that stores a data buffer on the heap.
lldb::offset_t GetByteSize() const override
Get the number of bytes in the data buffer.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Target * GetTargetPtr() const
Returns a pointer to the target object.
Process * GetProcessPtr() const
Returns a pointer to the process object.
Thread & GetThreadRef() const
Returns a reference to the thread object.
Thread * GetThreadPtr() const
Returns a pointer to the thread object.
"lldb/Expression/IRExecutionUnit.h" Contains the IR and, optionally, JIT- compiled code for a module.
lldb::addr_t FindSymbol(ConstString name, bool &missing_weak)
void Free(lldb::addr_t process_address, Status &error)
void ReadPointerFromMemory(lldb::addr_t *address, lldb::addr_t process_address, Status &error)
void GetMemoryData(DataExtractor &extractor, lldb::addr_t process_address, size_t size, Status &error)
void WritePointerToMemory(lldb::addr_t process_address, lldb::addr_t address, Status &error)
bool GetAllocSize(lldb::addr_t address, size_t &size)
void WriteMemory(lldb::addr_t process_address, const uint8_t *bytes, size_t size, Status &error)
void ReadMemory(uint8_t *bytes, lldb::addr_t process_address, size_t size, Status &error)
A plug-in interface definition class for debugging a process.
lldb::ExpressionResults RunThreadPlan(ExecutionContext &exe_ctx, lldb::ThreadPlanSP &thread_plan_sp, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager)
void SetRunningUserExpression(bool on)
unsigned long long ULongLong(unsigned long long fail_value=0) const
size_t GetAsMemoryData(void *dst, size_t dst_len, lldb::ByteOrder dst_byte_order, Status &error) const
long long SLongLong(long long fail_value=0) const
bool ShiftRightLogical(const Scalar &rhs)
llvm::APInt UInt128(const llvm::APInt &fail_value) const
void Clear()
Clear the object state.
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status FromErrorString(const char *str)
bool Success() const
Test for success condition.
llvm::StringRef GetString() const
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
const Value & GetValue() const
const Scalar & GetScalar() const
uint8_t * GetBytes()
Get a pointer to the data.
#define UNUSED_IF_ASSERT_DISABLED(x)
#define LLDB_INVALID_ADDRESS
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
ExpressionResults
The results of expression evaluation.
ByteOrder
Byte ordering definitions.
std::unique_ptr< uint8_t[]> data_up