LLDB mainline
|
#include "lldb/Expression/DWARFExpression.h"
#include <cinttypes>
#include <optional>
#include <vector>
#include "lldb/Core/Module.h"
#include "lldb/Core/Value.h"
#include "lldb/Core/dwarf.h"
#include "lldb/Utility/DataEncoder.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/Scalar.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/VMRange.h"
#include "lldb/Host/Host.h"
#include "lldb/Utility/Endian.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/StackID.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugLoc.h"
#include "llvm/DebugInfo/DWARF/DWARFExpression.h"
#include "Plugins/SymbolFile/DWARF/DWARFUnit.h"
Go to the source code of this file.
Functions | |
static llvm::Error | ReadRegisterValueAsScalar (RegisterContext *reg_ctx, lldb::RegisterKind reg_kind, uint32_t reg_num, Value &value) |
static offset_t | GetOpcodeDataSize (const DataExtractor &data, const lldb::offset_t data_offset, const uint8_t op, const DWARFUnit *dwarf_cu) |
Return the length in bytes of the set of operands for op . | |
static llvm::Error | Evaluate_DW_OP_entry_value (std::vector< Value > &stack, ExecutionContext *exe_ctx, RegisterContext *reg_ctx, const DataExtractor &opcodes, lldb::offset_t &opcode_offset, Log *log) |
static llvm::Expected< lldb::addr_t > | ResolveLoadAddress (ExecutionContext *exe_ctx, lldb::ModuleSP &module_sp, const char *dw_op_type, lldb::addr_t file_addr, Address &so_addr, bool check_sectionoffset=false) |
Helper function to move common code used to resolve a file address and turn into a load address. | |
static Scalar | DerefSizeExtractDataHelper (uint8_t *addr_bytes, size_t size_addr_bytes, ByteOrder byte_order, size_t size) |
Helper function to move common code used to load sized data from a uint8_t buffer. | |
|
static |
Helper function to move common code used to load sized data from a uint8_t buffer.
addr_bytes | uint8_t buffer containg raw data |
size_addr_bytes | how large is the underlying raw data |
byte_order | what is the byter order of the underlyig data |
size | How much of the underlying data we want to use |
Definition at line 810 of file DWARFExpression.cpp.
References lldb_private::DataExtractor::GetAddress(), and lldb_private::DataExtractor::GetMaxU64().
Referenced by lldb_private::DWARFExpression::Evaluate().
|
static |
Definition at line 531 of file DWARFExpression.cpp.
References lldb_private::DataExtractor::BytesLeft(), lldb_private::DWARFExpressionList::Evaluate(), lldb_private::SymbolContext::function, lldb_private::Function::GetCallEdgeForReturnAddress(), lldb_private::CallEdge::GetCallee(), lldb_private::CallEdge::GetCallSiteParameters(), lldb_private::DataExtractor::GetData(), lldb_private::StackFrame::GetFrameIndex(), lldb_private::ExecutionContext::GetFramePtr(), lldb_private::Target::GetImages(), lldb_private::Function::GetName(), lldb_private::ExecutionContext::GetRegisterContext(), lldb_private::Thread::GetStackFrameAtIndex(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::Function::GetTailCallingEdges(), lldb_private::ExecutionContext::GetTargetRef(), lldb_private::ExecutionContext::GetThreadPtr(), lldb_private::DataExtractor::GetULEB128(), lldb_private::ExecutionContext::HasTargetScope(), LLDB_INVALID_ADDRESS, LLDB_LOG, lldb_private::CallSiteParameter::LocationInCaller, and lldb_private::ExecutionContext::SetFrameSP().
Referenced by lldb_private::DWARFExpression::Evaluate().
|
static |
Return the length in bytes of the set of operands for op
.
No guarantees are made on the state of data
after this call.
Definition at line 133 of file DWARFExpression.cpp.
References lldb_private::DataExtractor::GetAddressByteSize(), lldb_private::plugin::dwarf::DWARFUnit::GetSymbolFileDWARF(), lldb_private::DataExtractor::GetULEB128(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetVendorDWARFOpcodeSize(), LLDB_INVALID_OFFSET, and lldb_private::DataExtractor::Skip_LEB128().
Referenced by lldb_private::DWARFExpression::ContainsThreadLocalStorage(), lldb_private::DWARFExpression::GetLocation_DW_OP_addr(), lldb_private::DWARFExpression::LinkThreadLocalStorage(), and lldb_private::DWARFExpression::Update_DW_OP_addr().
|
static |
Definition at line 97 of file DWARFExpression.cpp.
References lldb_private::RegisterContext::ConvertRegisterKindToRegisterNumber(), lldb_private::RegisterContext::GetRegisterInfoAtIndex(), lldb_private::Value::GetScalar(), lldb_private::RegisterValue::GetScalarValue(), LLDB_INVALID_REGNUM, lldb_private::RegisterInfo::name, lldb_private::RegisterContext::ReadRegister(), lldb_private::Value::RegisterInfo, lldb_private::Value::Scalar, lldb_private::Value::SetContext(), and lldb_private::Value::SetValueType().
Referenced by lldb_private::DWARFExpression::Evaluate().
|
static |
Helper function to move common code used to resolve a file address and turn into a load address.
exe_ctx | Pointer to the execution context |
module_sp | shared_ptr contains the module if we have one |
dw_op_type | C-style string used to vary the error output |
file_addr | the file address we are trying to resolve and turn into a load address |
so_addr | out parameter, will be set to load address or section offset |
check_sectionoffset | bool which determines if having a section offset but not a load address is considerd a success |
Definition at line 783 of file DWARFExpression.cpp.
References lldb_private::Address::GetLoadAddress(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::Address::IsSectionOffset(), and LLDB_INVALID_ADDRESS.
Referenced by lldb_private::DWARFExpression::Evaluate().