aboutsummaryrefslogtreecommitdiff
path: root/source/Expression
diff options
context:
space:
mode:
Diffstat (limited to 'source/Expression')
-rw-r--r--source/Expression/ClangASTSource.cpp11
-rw-r--r--source/Expression/ClangExpressionDeclMap.cpp2
-rw-r--r--source/Expression/ClangExpressionParser.cpp4
-rw-r--r--source/Expression/ClangUserExpression.cpp4
-rw-r--r--source/Expression/DWARFExpression.cpp99
-rw-r--r--source/Expression/IRDynamicChecks.cpp27
-rw-r--r--source/Expression/IRExecutionUnit.cpp30
-rw-r--r--source/Expression/IRForTarget.cpp45
-rw-r--r--source/Expression/Materializer.cpp10
9 files changed, 177 insertions, 55 deletions
diff --git a/source/Expression/ClangASTSource.cpp b/source/Expression/ClangASTSource.cpp
index 316efdf9c149..853d102c5426 100644
--- a/source/Expression/ClangASTSource.cpp
+++ b/source/Expression/ClangASTSource.cpp
@@ -318,6 +318,10 @@ ClangASTSource::CompleteType (clang::ObjCInterfaceDecl *interface_decl)
m_ast_importer->CompleteObjCInterfaceDecl (interface_decl);
+ if (interface_decl->getSuperClass() &&
+ interface_decl->getSuperClass() != interface_decl)
+ CompleteType(interface_decl->getSuperClass());
+
if (log)
{
log->Printf(" [COID] After:");
@@ -970,6 +974,9 @@ ClangASTSource::FindObjCMethodDecls (NameSearchContext &context)
}
ss.Flush();
+ if (strstr(ss.GetData(), "$__lldb"))
+ return; // we don't need any results
+
ConstString selector_name(ss.GetData());
if (log)
@@ -1771,14 +1778,14 @@ NameSearchContext::AddFunDecl (const ClangASTType &type)
if (func_proto_type)
{
- unsigned NumArgs = func_proto_type->getNumArgs();
+ unsigned NumArgs = func_proto_type->getNumParams();
unsigned ArgIndex;
SmallVector<ParmVarDecl *, 5> parm_var_decls;
for (ArgIndex = 0; ArgIndex < NumArgs; ++ArgIndex)
{
- QualType arg_qual_type (func_proto_type->getArgType(ArgIndex));
+ QualType arg_qual_type (func_proto_type->getParamType(ArgIndex));
parm_var_decls.push_back(ParmVarDecl::Create (*ast,
const_cast<DeclContext*>(m_decl_context),
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index 87c984ddcfb9..64ef98297cd2 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -1605,6 +1605,8 @@ ClangExpressionDeclMap::AddOneVariable (NameSearchContext &context, VariableSP v
{
if (const TagType *tag_type = dyn_cast<TagType>(parser_type))
CompleteType(tag_type->getDecl());
+ if (const ObjCObjectPointerType *objc_object_ptr_type = dyn_cast<ObjCObjectPointerType>(parser_type))
+ CompleteType(objc_object_ptr_type->getInterfaceDecl());
}
diff --git a/source/Expression/ClangExpressionParser.cpp b/source/Expression/ClangExpressionParser.cpp
index f0de1edc90d3..615f29fd0c76 100644
--- a/source/Expression/ClangExpressionParser.cpp
+++ b/source/Expression/ClangExpressionParser.cpp
@@ -16,6 +16,7 @@
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Disassembler.h"
#include "lldb/Core/Stream.h"
+#include "lldb/Core/StreamFile.h"
#include "lldb/Core/StreamString.h"
#include "lldb/Expression/ClangASTSource.h"
#include "lldb/Expression/ClangExpression.h"
@@ -35,7 +36,6 @@
#include "clang/Basic/Version.h"
#include "clang/CodeGen/CodeGenAction.h"
#include "clang/CodeGen/ModuleBuilder.h"
-#include "clang/Driver/CC1Options.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Frontend/FrontendActions.h"
@@ -506,7 +506,7 @@ ClangExpressionParser::PrepareForExecution (lldb::addr_t &func_addr,
Stream *error_stream = NULL;
Target *target = exe_ctx.GetTargetPtr();
if (target)
- error_stream = &target->GetDebugger().GetErrorStream();
+ error_stream = target->GetDebugger().GetErrorFile().get();
IRForTarget ir_for_target(decl_map,
m_expr.NeedsVariableResolution(),
diff --git a/source/Expression/ClangUserExpression.cpp b/source/Expression/ClangUserExpression.cpp
index d9ecd41be97a..6b0eee8cf363 100644
--- a/source/Expression/ClangUserExpression.cpp
+++ b/source/Expression/ClangUserExpression.cpp
@@ -1024,7 +1024,9 @@ ClangUserExpression::Evaluate (ExecutionContext &exe_ctx,
}
if (result_valobj_sp.get() == NULL)
- result_valobj_sp = ValueObjectConstResult::Create (NULL, error);
+ {
+ result_valobj_sp = ValueObjectConstResult::Create (exe_ctx.GetBestExecutionContextScope(), error);
+ }
return execution_results;
}
diff --git a/source/Expression/DWARFExpression.cpp b/source/Expression/DWARFExpression.cpp
index b36be8e545d9..28aa6d02a56d 100644
--- a/source/Expression/DWARFExpression.cpp
+++ b/source/Expression/DWARFExpression.cpp
@@ -1429,6 +1429,12 @@ DWARFExpression::Evaluate
//----------------------------------------------------------------------
case DW_OP_deref:
{
+ if (stack.empty())
+ {
+ if (error_ptr)
+ error_ptr->SetErrorString("Expression stack empty for DW_OP_deref.");
+ return false;
+ }
Value::ValueType value_type = stack.back().GetValueType();
switch (value_type)
{
@@ -1504,6 +1510,12 @@ DWARFExpression::Evaluate
//----------------------------------------------------------------------
case DW_OP_deref_size:
{
+ if (stack.empty())
+ {
+ if (error_ptr)
+ error_ptr->SetErrorString("Expression stack empty for DW_OP_deref_size.");
+ return false;
+ }
uint8_t size = opcodes.GetU8(&offset);
Value::ValueType value_type = stack.back().GetValueType();
switch (value_type)
@@ -2562,9 +2574,90 @@ DWARFExpression::Evaluate
// variable a particular DWARF expression refers to.
//----------------------------------------------------------------------
case DW_OP_piece:
- if (error_ptr)
- error_ptr->SetErrorString ("Unimplemented opcode DW_OP_piece.");
- return false;
+ if (stack.size() < 1)
+ {
+ if (error_ptr)
+ error_ptr->SetErrorString("Expression stack needs at least 1 item for DW_OP_piece.");
+ return false;
+ }
+ else
+ {
+ const uint64_t piece_byte_size = opcodes.GetULEB128(&offset);
+ switch (stack.back().GetValueType())
+ {
+ case Value::eValueTypeScalar:
+ case Value::eValueTypeFileAddress:
+ case Value::eValueTypeLoadAddress:
+ case Value::eValueTypeHostAddress:
+ {
+ uint32_t bit_size = piece_byte_size * 8;
+ uint32_t bit_offset = 0;
+ if (!stack.back().GetScalar().ExtractBitfield (bit_size, bit_offset))
+ {
+ if (error_ptr)
+ error_ptr->SetErrorStringWithFormat("unable to extract %" PRIu64 " bytes from a %" PRIu64 " byte scalar value.", piece_byte_size, (uint64_t)stack.back().GetScalar().GetByteSize());
+ return false;
+ }
+ }
+ break;
+
+ case Value::eValueTypeVector:
+ {
+ if (stack.back().GetVector().length >= piece_byte_size)
+ stack.back().GetVector().length = piece_byte_size;
+ else
+ {
+ if (error_ptr)
+ error_ptr->SetErrorStringWithFormat("unable to extract %" PRIu64 " bytes from a %" PRIu64 " byte vector value.", piece_byte_size, (uint64_t)stack.back().GetVector().length);
+ return false;
+ }
+ }
+ break;
+ }
+ }
+ break;
+
+ case DW_OP_bit_piece: // 0x9d ULEB128 bit size, ULEB128 bit offset (DWARF3);
+ if (stack.size() < 1)
+ {
+ if (error_ptr)
+ error_ptr->SetErrorString("Expression stack needs at least 1 item for DW_OP_bit_piece.");
+ return false;
+ }
+ else
+ {
+ const uint64_t piece_bit_size = opcodes.GetULEB128(&offset);
+ const uint64_t piece_bit_offset = opcodes.GetULEB128(&offset);
+ switch (stack.back().GetValueType())
+ {
+ case Value::eValueTypeScalar:
+ case Value::eValueTypeFileAddress:
+ case Value::eValueTypeLoadAddress:
+ case Value::eValueTypeHostAddress:
+ {
+ if (!stack.back().GetScalar().ExtractBitfield (piece_bit_size, piece_bit_offset))
+ {
+ if (error_ptr)
+ error_ptr->SetErrorStringWithFormat("unable to extract %" PRIu64 " bit value with %" PRIu64 " bit offset from a %" PRIu64 " bit scalar value.",
+ piece_bit_size,
+ piece_bit_offset,
+ (uint64_t)(stack.back().GetScalar().GetByteSize()*8));
+ return false;
+ }
+ }
+ break;
+
+ case Value::eValueTypeVector:
+ if (error_ptr)
+ {
+ error_ptr->SetErrorStringWithFormat ("unable to extract %" PRIu64 " bit value with %" PRIu64 " bit offset from a vector value.",
+ piece_bit_size,
+ piece_bit_offset);
+ }
+ return false;
+ }
+ }
+ break;
//----------------------------------------------------------------------
// OPCODE: DW_OP_push_object_address
diff --git a/source/Expression/IRDynamicChecks.cpp b/source/Expression/IRDynamicChecks.cpp
index 4030f149ab2d..a75a0fca9c62 100644
--- a/source/Expression/IRDynamicChecks.cpp
+++ b/source/Expression/IRDynamicChecks.cpp
@@ -19,6 +19,7 @@
#include "llvm/Support/raw_ostream.h"
#include "llvm/IR/Constants.h"
+#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
@@ -145,7 +146,8 @@ public:
DynamicCheckerFunctions &checker_functions) :
m_module(module),
m_checker_functions(checker_functions),
- m_i8ptr_ty(NULL)
+ m_i8ptr_ty(NULL),
+ m_intptr_ty(NULL)
{
}
@@ -279,9 +281,6 @@ protected:
//------------------------------------------------------------------
llvm::Value *BuildPointerValidatorFunc(lldb::addr_t start_address)
{
- IntegerType *intptr_ty = llvm::Type::getIntNTy(m_module.getContext(),
- (m_module.getPointerSize() == llvm::Module::Pointer64) ? 64 : 32);
-
llvm::Type *param_array[1];
param_array[0] = const_cast<llvm::PointerType*>(GetI8PtrTy());
@@ -290,7 +289,7 @@ protected:
FunctionType *fun_ty = FunctionType::get(llvm::Type::getVoidTy(m_module.getContext()), params, true);
PointerType *fun_ptr_ty = PointerType::getUnqual(fun_ty);
- Constant *fun_addr_int = ConstantInt::get(intptr_ty, start_address, false);
+ Constant *fun_addr_int = ConstantInt::get(GetIntptrTy(), start_address, false);
return ConstantExpr::getIntToPtr(fun_addr_int, fun_ptr_ty);
}
@@ -306,9 +305,6 @@ protected:
//------------------------------------------------------------------
llvm::Value *BuildObjectCheckerFunc(lldb::addr_t start_address)
{
- IntegerType *intptr_ty = llvm::Type::getIntNTy(m_module.getContext(),
- (m_module.getPointerSize() == llvm::Module::Pointer64) ? 64 : 32);
-
llvm::Type *param_array[2];
param_array[0] = const_cast<llvm::PointerType*>(GetI8PtrTy());
@@ -318,7 +314,7 @@ protected:
FunctionType *fun_ty = FunctionType::get(llvm::Type::getVoidTy(m_module.getContext()), params, true);
PointerType *fun_ptr_ty = PointerType::getUnqual(fun_ty);
- Constant *fun_addr_int = ConstantInt::get(intptr_ty, start_address, false);
+ Constant *fun_addr_int = ConstantInt::get(GetIntptrTy(), start_address, false);
return ConstantExpr::getIntToPtr(fun_addr_int, fun_ptr_ty);
}
@@ -330,6 +326,18 @@ protected:
return m_i8ptr_ty;
}
+ IntegerType *GetIntptrTy()
+ {
+ if (!m_intptr_ty)
+ {
+ llvm::DataLayout data_layout(&m_module);
+
+ m_intptr_ty = llvm::Type::getIntNTy(m_module.getContext(), data_layout.getPointerSizeInBits());
+ }
+
+ return m_intptr_ty;
+ }
+
typedef std::vector <llvm::Instruction *> InstVector;
typedef InstVector::iterator InstIterator;
@@ -338,6 +346,7 @@ protected:
DynamicCheckerFunctions &m_checker_functions; ///< The dynamic checker functions for the process
private:
PointerType *m_i8ptr_ty;
+ IntegerType *m_intptr_ty;
};
class ValidPointerChecker : public Instrumenter
diff --git a/source/Expression/IRExecutionUnit.cpp b/source/Expression/IRExecutionUnit.cpp
index 104732a283c2..17bd03ae6cb5 100644
--- a/source/Expression/IRExecutionUnit.cpp
+++ b/source/Expression/IRExecutionUnit.cpp
@@ -75,12 +75,7 @@ IRExecutionUnit::WriteNow (const uint8_t *bytes,
if (err.Success())
{
DataExtractor my_extractor(my_buffer.GetBytes(), my_buffer.GetByteSize(), lldb::eByteOrderBig, 8);
-
- StreamString ss;
-
- my_extractor.Dump(&ss, 0, lldb::eFormatBytesWithASCII, 1, my_buffer.GetByteSize(), 32, allocation_process_addr, 0, 0);
-
- log->PutCString(ss.GetData());
+ my_extractor.PutToLog(log, 0, my_buffer.GetByteSize(), allocation_process_addr, 16, DataExtractor::TypeUInt8);
}
}
@@ -243,6 +238,8 @@ IRExecutionUnit::GetRunnableInfo(Error &error,
{
lldb::ProcessSP process_sp(GetProcessWP().lock());
+ static Mutex s_runnable_info_mutex(Mutex::Type::eMutexTypeRecursive);
+
func_addr = LLDB_INVALID_ADDRESS;
func_end = LLDB_INVALID_ADDRESS;
@@ -261,6 +258,8 @@ IRExecutionUnit::GetRunnableInfo(Error &error,
return;
};
+ Mutex::Locker runnable_info_mutex_locker(s_runnable_info_mutex);
+
m_did_jit = true;
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
@@ -394,6 +393,25 @@ IRExecutionUnit::GetRunnableInfo(Error &error,
{
log->Printf("Function disassembly:\n%s", disassembly_stream.GetData());
}
+
+ log->Printf("Sections: ");
+ for (AllocationRecord &record : m_records)
+ {
+ if (record.m_process_address != LLDB_INVALID_ADDRESS)
+ {
+ record.dump(log);
+
+ DataBufferHeap my_buffer(record.m_size, 0);
+ Error err;
+ ReadMemory(my_buffer.GetBytes(), record.m_process_address, record.m_size, err);
+
+ if (err.Success())
+ {
+ DataExtractor my_extractor(my_buffer.GetBytes(), my_buffer.GetByteSize(), lldb::eByteOrderBig, 8);
+ my_extractor.PutToLog(log, 0, my_buffer.GetByteSize(), record.m_process_address, 16, DataExtractor::TypeUInt8);
+ }
+ }
+ }
}
func_addr = m_function_load_addr;
diff --git a/source/Expression/IRForTarget.cpp b/source/Expression/IRForTarget.cpp
index d68dc002a5a5..a998896a98fd 100644
--- a/source/Expression/IRForTarget.cpp
+++ b/source/Expression/IRForTarget.cpp
@@ -105,6 +105,7 @@ IRForTarget::IRForTarget (lldb_private::ClangExpressionDeclMap *decl_map,
m_data_allocator(execution_unit),
m_CFStringCreateWithBytes(NULL),
m_sel_registerName(NULL),
+ m_intptr_ty(NULL),
m_error_stream(error_stream),
m_result_store(NULL),
m_result_is_pointer(false),
@@ -285,10 +286,8 @@ llvm::Constant *
IRForTarget::BuildFunctionPointer (llvm::Type *type,
uint64_t ptr)
{
- IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize() == Module::Pointer64) ? 64 : 32);
PointerType *fun_ptr_ty = PointerType::getUnqual(type);
- Constant *fun_addr_int = ConstantInt::get(intptr_ty, ptr, false);
+ Constant *fun_addr_int = ConstantInt::get(m_intptr_ty, ptr, false);
return ConstantExpr::getIntToPtr(fun_addr_int, fun_ptr_ty);
}
@@ -726,9 +725,6 @@ IRForTarget::RewriteObjCConstString (llvm::GlobalVariable *ns_str,
Type *ns_str_ty = ns_str->getType();
Type *i8_ptr_ty = Type::getInt8PtrTy(m_module->getContext());
- IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize()
- == Module::Pointer64) ? 64 : 32);
Type *i32_ty = Type::getInt32Ty(m_module->getContext());
Type *i8_ty = Type::getInt8Ty(m_module->getContext());
@@ -775,7 +771,7 @@ IRForTarget::RewriteObjCConstString (llvm::GlobalVariable *ns_str,
arg_type_array[0] = i8_ptr_ty;
arg_type_array[1] = i8_ptr_ty;
- arg_type_array[2] = intptr_ty;
+ arg_type_array[2] = m_intptr_ty;
arg_type_array[3] = i32_ty;
arg_type_array[4] = i8_ty;
@@ -785,7 +781,7 @@ IRForTarget::RewriteObjCConstString (llvm::GlobalVariable *ns_str,
// Build the constant containing the pointer to the function
PointerType *CFSCWB_ptr_ty = PointerType::getUnqual(CFSCWB_ty);
- Constant *CFSCWB_addr_int = ConstantInt::get(intptr_ty, CFStringCreateWithBytes_addr, false);
+ Constant *CFSCWB_addr_int = ConstantInt::get(m_intptr_ty, CFStringCreateWithBytes_addr, false);
m_CFStringCreateWithBytes = ConstantExpr::getIntToPtr(CFSCWB_addr_int, CFSCWB_ptr_ty);
}
@@ -796,7 +792,7 @@ IRForTarget::RewriteObjCConstString (llvm::GlobalVariable *ns_str,
Constant *alloc_arg = Constant::getNullValue(i8_ptr_ty);
Constant *bytes_arg = cstr ? ConstantExpr::getBitCast(cstr, i8_ptr_ty) : Constant::getNullValue(i8_ptr_ty);
- Constant *numBytes_arg = ConstantInt::get(intptr_ty, cstr ? string_array->getNumElements() - 1 : 0, false);
+ Constant *numBytes_arg = ConstantInt::get(m_intptr_ty, cstr ? string_array->getNumElements() - 1 : 0, false);
Constant *encoding_arg = ConstantInt::get(i32_ty, 0x0600, false); /* 0x0600 is kCFStringEncodingASCII */
Constant *isExternal_arg = ConstantInt::get(i8_ty, 0x0, false); /* 0x0 is false */
@@ -1149,10 +1145,8 @@ IRForTarget::RewriteObjCSelector (Instruction* selector_load)
llvm::Type *srN_type = FunctionType::get(sel_ptr_type, srN_arg_types, false);
// Build the constant containing the pointer to the function
- IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize() == Module::Pointer64) ? 64 : 32);
PointerType *srN_ptr_ty = PointerType::getUnqual(srN_type);
- Constant *srN_addr_int = ConstantInt::get(intptr_ty, sel_registerName_addr, false);
+ Constant *srN_addr_int = ConstantInt::get(m_intptr_ty, sel_registerName_addr, false);
m_sel_registerName = ConstantExpr::getIntToPtr(srN_addr_int, srN_ptr_ty);
}
@@ -1599,10 +1593,8 @@ IRForTarget::HandleSymbol (Value *symbol)
log->Printf("Found \"%s\" at 0x%" PRIx64, name.GetCString(), symbol_addr);
Type *symbol_type = symbol->getType();
- IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize() == Module::Pointer64) ? 64 : 32);
- Constant *symbol_addr_int = ConstantInt::get(intptr_ty, symbol_addr, false);
+ Constant *symbol_addr_int = ConstantInt::get(m_intptr_ty, symbol_addr, false);
Value *symbol_addr_ptr = ConstantExpr::getIntToPtr(symbol_addr_int, symbol_type);
@@ -1680,11 +1672,7 @@ IRForTarget::HandleObjCClass(Value *classlist_reference)
if (load_instructions.empty())
return false;
- IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize()
- == Module::Pointer64) ? 64 : 32);
-
- Constant *class_addr = ConstantInt::get(intptr_ty, (uint64_t)class_ptr);
+ Constant *class_addr = ConstantInt::get(m_intptr_ty, (uint64_t)class_ptr);
for (LoadInst *load_instruction : load_instructions)
{
@@ -2499,10 +2487,7 @@ IRForTarget::ReplaceVariables (Function &llvm_function)
llvm::Constant *
IRForTarget::BuildRelocation(llvm::Type *type, uint64_t offset)
{
- IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize() == Module::Pointer64) ? 64 : 32);
-
- llvm::Constant *offset_int = ConstantInt::get(intptr_ty, offset);
+ llvm::Constant *offset_int = ConstantInt::get(m_intptr_ty, offset);
llvm::Constant *offset_array[1];
@@ -2537,10 +2522,7 @@ IRForTarget::CompleteDataAllocation ()
if (!allocation || allocation == LLDB_INVALID_ADDRESS)
return false;
- IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize() == Module::Pointer64) ? 64 : 32);
-
- Constant *relocated_addr = ConstantInt::get(intptr_ty, (uint64_t)allocation);
+ Constant *relocated_addr = ConstantInt::get(m_intptr_ty, (uint64_t)allocation);
Constant *relocated_bitcast = ConstantExpr::getIntToPtr(relocated_addr, llvm::Type::getInt8PtrTy(m_module->getContext()));
m_reloc_placeholder->replaceAllUsesWith(relocated_bitcast);
@@ -2607,6 +2589,7 @@ IRForTarget::runOnModule (Module &llvm_module)
m_module = &llvm_module;
m_target_data.reset(new DataLayout(m_module));
+ m_intptr_ty = llvm::Type::getIntNTy(m_module->getContext(), m_target_data->getPointerSizeInBits());
if (log)
{
@@ -2641,13 +2624,13 @@ IRForTarget::runOnModule (Module &llvm_module)
return false;
}
- llvm::Type *intptr_ty = Type::getInt8Ty(m_module->getContext());
+ llvm::Type *int8_ty = Type::getInt8Ty(m_module->getContext());
m_reloc_placeholder = new llvm::GlobalVariable((*m_module),
- intptr_ty,
+ int8_ty,
false /* IsConstant */,
GlobalVariable::InternalLinkage,
- Constant::getNullValue(intptr_ty),
+ Constant::getNullValue(int8_ty),
"reloc_placeholder",
NULL /* InsertBefore */,
GlobalVariable::NotThreadLocal /* ThreadLocal */,
diff --git a/source/Expression/Materializer.cpp b/source/Expression/Materializer.cpp
index 8731fbebd148..90687c0739d9 100644
--- a/source/Expression/Materializer.cpp
+++ b/source/Expression/Materializer.cpp
@@ -461,7 +461,9 @@ public:
}
else
{
- lldb::addr_t addr_of_valobj = valobj_sp->GetAddressOf();
+ AddressType address_type = eAddressTypeInvalid;
+ const bool scalar_is_load_address = false;
+ lldb::addr_t addr_of_valobj = valobj_sp->GetAddressOf(scalar_is_load_address, &address_type);
if (addr_of_valobj != LLDB_INVALID_ADDRESS)
{
Error write_error;
@@ -503,6 +505,9 @@ public:
size_t bit_align = m_variable_sp->GetType()->GetClangLayoutType().GetTypeBitAlign();
size_t byte_align = (bit_align + 7) / 8;
+ if (!byte_align)
+ byte_align = 1;
+
Error alloc_error;
m_temporary_allocation = map.Malloc(data.GetByteSize(), byte_align, lldb::ePermissionsReadable | lldb::ePermissionsWritable, IRMemoryMap::eAllocationPolicyMirror, alloc_error);
@@ -739,6 +744,9 @@ public:
size_t bit_align = m_type.GetTypeBitAlign();
size_t byte_align = (bit_align + 7) / 8;
+ if (!byte_align)
+ byte_align = 1;
+
Error alloc_error;
m_temporary_allocation = map.Malloc(byte_size, byte_align, lldb::ePermissionsReadable | lldb::ePermissionsWritable, IRMemoryMap::eAllocationPolicyMirror, alloc_error);