|
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/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/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/DWARFExpressionPrinter.h"#include "llvm/DebugInfo/DWARF/LowLevel/DWARFExpression.h"#include "llvm/Support/ErrorExtras.h"Go to the source code of this file.
Functions | |
| static lldb::offset_t | GetOpcodeDataSize (const DataExtractor &data, const lldb::offset_t data_offset, const LocationAtom op, const DWARFExpression::Delegate *dwarf_cu) |
Return the length in bytes of the set of operands for op. | |
| static const char * | DW_OP_value_to_name (uint32_t val) |
| static llvm::Error | Evaluate_DW_OP_entry_value (EvalContext &eval_ctx, llvm::ArrayRef< uint8_t > subexpr) |
| static void | UpdateValueTypeFromLocationDescription (EvalContext &eval_ctx, LocationDescriptionKind kind, Value *value=nullptr) |
| Adjust value's ValueType according to the kind of location description. | |
| static llvm::Expected< lldb::addr_t > | ResolveLoadAddress (EvalContext &eval_ctx, 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 load sized data from a uint8_t buffer. | |
| static llvm::Error | Evaluate_DW_OP_deref (EvalContext &eval_ctx, LocationAtom opcode, unsigned size, size_t size_addr_bytes) |
| static llvm::Error | Evaluate_DW_OP_piece (EvalContext &eval_ctx, uint64_t piece_byte_size) |
| static llvm::Error | Evaluate_DW_OP_convert (EvalContext &eval_ctx, uint64_t relative_die_offset) |
| static llvm::Error | Evaluate_DW_OP_form_tls_address (EvalContext &eval_ctx, LocationAtom opcode) |
| static llvm::Error | Evaluate_DW_OP_fbreg (EvalContext &eval_ctx, int64_t fbreg_offset) |
| static llvm::Error | Evaluate_DW_OP_call_frame_cfa (EvalContext &eval_ctx) |
|
static |
Helper function to load sized data from a uint8_t buffer.
| addr_bytes | The buffer containing raw data. |
| size_addr_bytes | How large is the underlying raw data. |
| byte_order | What is the byte order of the underlying data. |
| size | How much of the underlying data we want to use. |
Definition at line 916 of file DWARFExpression.cpp.
References lldb_private::DataExtractor::GetAddress(), and lldb_private::DataExtractor::GetMaxU64().
Referenced by Evaluate_DW_OP_deref().
|
static |
Definition at line 457 of file DWARFExpression.cpp.
Referenced by lldb_private::DWARFExpression::Evaluate(), Evaluate_DW_OP_deref(), and lldb_private::DWARFExpression::GetLocation_DW_OP_addr().
|
static |
Definition at line 1275 of file DWARFExpression.cpp.
References lldb_private::StackFrame::GetStackID(), LLDB_INVALID_ADDRESS, and lldb_private::Value::LoadAddress.
Referenced by lldb_private::DWARFExpression::Evaluate().
|
static |
Definition at line 1202 of file DWARFExpression.cpp.
References lldb_private::DWARFExpression::Delegate::GetDIEBitSizeAndSign().
Referenced by lldb_private::DWARFExpression::Evaluate().
|
static |
Definition at line 927 of file DWARFExpression.cpp.
References DerefSizeExtractDataHelper(), DW_OP_value_to_name(), error(), lldb_private::Value::FileAddress, lldb_private::ObjectFile::GetByteOrder(), lldb_private::Process::GetByteOrder(), lldb_private::Value::HostAddress, lldb_private::Value::Invalid, lldb_private::Address::IsSectionOffset(), LLDB_INVALID_ADDRESS, lldb_private::Value::LoadAddress, lldb_private::Memory, lldb_private::Process::ReadMemory(), lldb_private::Target::ReadMemory(), ResolveLoadAddress(), lldb_private::Value::Scalar, and lldb_private::Scalar::TruncOrExtendTo().
Referenced by lldb_private::DWARFExpression::Evaluate().
|
static |
Definition at line 655 of file DWARFExpression.cpp.
References lldb_private::DataExtractor::BytesLeft(), lldb_private::DWARFExpressionList::Evaluate(), lldb_private::Expressions, 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::GetLog(), lldb_private::Function::GetName(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::Function::GetTailCallingEdges(), lldb_private::ExecutionContext::GetTargetRef(), lldb_private::ExecutionContext::GetThreadPtr(), 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 |
Definition at line 1258 of file DWARFExpression.cpp.
References lldb_private::StackFrame::GetFrameBaseValue(), and lldb_private::Value::LoadAddress.
Referenced by lldb_private::DWARFExpression::Evaluate().
|
static |
Definition at line 1228 of file DWARFExpression.cpp.
References lldb_private::ExecutionContext::GetThreadPtr(), LLDB_INVALID_ADDRESS, and lldb_private::Value::LoadAddress.
Referenced by lldb_private::DWARFExpression::Evaluate().
|
static |
Definition at line 1071 of file DWARFExpression.cpp.
References lldb_private::Value::AppendDataToHostBuffer(), lldb_private::Value::ConvertToLoadAddress(), error(), lldb_private::Scalar::ExtractBitfield(), lldb_private::Value::FileAddress, lldb_private::Value::GetBuffer(), lldb_private::WritableDataBuffer::GetBytes(), lldb_private::DataBufferHeap::GetByteSize(), lldb_private::Scalar::GetByteSize(), lldb_private::Value::GetScalar(), lldb_private::Value::GetValueType(), lldb_private::Value::HostAddress, lldb_private::Value::Invalid, LLDB_INVALID_ADDRESS, lldb_private::Value::LoadAddress, lldb_private::Memory, lldb_private::Target::ReadMemory(), lldb_private::Value::ResizeData(), lldb_private::Value::Scalar, lldb_private::Scalar::TruncOrExtendTo(), lldb_private::Scalar::ULongLong(), and UpdateValueTypeFromLocationDescription().
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 194 of file DWARFExpression.cpp.
References lldb_private::DataExtractor::GetAddressByteSize(), lldb_private::DWARFExpression::Delegate::GetAddressByteSize(), lldb_private::DataExtractor::GetU8(), lldb_private::DataExtractor::GetULEB128(), lldb_private::DWARFExpression::Delegate::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 |
Helper function to move common code used to resolve a file address and turn into a load address.
| eval_ctx | Evaluation context (provides exe_ctx and module_sp). |
| 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 890 of file DWARFExpression.cpp.
References lldb_private::Address::GetLoadAddress(), lldb_private::Address::IsSectionOffset(), and LLDB_INVALID_ADDRESS.
Referenced by ProcessMachCore::DoGetMemoryRegionInfo(), and Evaluate_DW_OP_deref().
|
static |
Adjust value's ValueType according to the kind of location description.
Definition at line 841 of file DWARFExpression.cpp.
References Empty, lldb_private::Expressions, lldb_private::GetLog(), lldb_private::DWARFExpression::Delegate::GetVersion(), LLDB_LOGF, lldb_private::Value::LoadAddress, lldb_private::Memory, and lldb_private::Value::Scalar.
Referenced by lldb_private::DWARFExpression::Evaluate(), and Evaluate_DW_OP_piece().