15#include "llvm/Support/Error.h"
27 std::optional<uint64_t> byte_size =
28 llvm::expectedToOptional(valobj_sp->GetByteSize());
29 if (byte_size && *byte_size) {
30 if (valobj_sp->GetDataExtractor().GetByteSize() < *byte_size) {
31 valobj_sp->GetValue().ResizeData(*byte_size);
32 valobj_sp->GetValue().GetData(valobj_sp->GetDataExtractor());
34 return const_cast<uint8_t *
>(valobj_sp->GetDataExtractor().GetDataStart());
64 if (!
m_frozen_sp->GetCompilerType().IsPointerOrReferenceType())
70 !process_sp->IsPossibleDynamicValue(*(
m_frozen_sp.get())))
87 llvm::Expected<lldb::addr_t> cur_value =
88 process_sp->ReadPointerFromMemory(live_addr);
90 llvm::consumeError(cur_value.takeError());
94 if (*cur_value != static_addr.
address) {
96 "Stored value: {0} read from {1} doesn't "
97 "match static addr: {2}",
98 *cur_value, live_addr, static_addr.
address);
102 if (!process_sp->WritePointerToMemory(live_addr, dynamic_addr.
address,
104 LLDB_LOG(log,
"Got error: {0} writing dynamic value: {1} to {2}",
error,
105 dynamic_addr.
address, live_addr);
128 LLDB_LOGF(log,
"Registering JITted Functions:\n");
131 execution_unit_sp->GetJittedFunctions()) {
132 if (jitted_function.m_external &&
133 jitted_function.m_name != execution_unit_sp->GetFunctionName() &&
136 jitted_function.m_remote_addr;
137 LLDB_LOGF(log,
" Function: %s at 0x%" PRIx64
".",
138 jitted_function.m_name.GetCString(),
139 jitted_function.m_remote_addr);
143 LLDB_LOGF(log,
"Registering JIIted Symbols:\n");
146 execution_unit_sp->GetJittedGlobalVariables()) {
151 Mangled mangler(global_var.m_name);
153 m_symbol_map[global_var.m_name.GetCString()] = global_var.m_remote_addr;
154 LLDB_LOGF(log,
" Symbol: %s at 0x%" PRIx64
".",
155 global_var.m_name.GetCString(), global_var.m_remote_addr);
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
#define LLDB_LOGF(log,...)
A uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
lldb::ValueObjectSP m_live_sp
The ValueObject counterpart to m_frozen_sp that tracks the value in inferior memory.
void TransferAddress(bool force=false)
This function is used to copy the address-of m_live_sp into m_frozen_sp.
uint8_t * GetValueBytes()
lldb::ValueObjectSP m_frozen_sp
These members should be private.
lldb::ValueObjectSP GetValueObject()
lldb::DynamicValueType m_dyn_option
static char ID
LLVM RTTI support.
A class that handles mangled names.
ConstString GetDemangledName() const
Demangled name get accessor.
void RegisterExecutionUnit(lldb::IRExecutionUnitSP &execution_unit_sp)
static char ID
LLVM RTTI support.
ExecutionUnitSet m_execution_units
The execution units that contain valuable symbols.
virtual ~PersistentExpressionState()
SymbolMap m_symbol_map
The addresses of the symbols in m_execution_units.
PersistentExpressionState()
virtual lldb::addr_t LookupSymbol(ConstString name)
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
@ eAddressTypeLoad
Address is an address as in the current target inferior process.
std::shared_ptr< lldb_private::IRExecutionUnit > IRExecutionUnitSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::Process > ProcessSP
"lldb/Expression/IRExecutionUnit.h" Encapsulates a single function that has been generated by the JIT...