summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp37
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp15
2 files changed, 29 insertions, 23 deletions
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
index 0d1e74b2513..182294d65b5 100644
--- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
+++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
@@ -106,19 +106,22 @@ PadString(Stream *s, const std::string &str, size_t width)
s->Printf("%s ", str.c_str());
}
static void
-AddSymbolicInfo (ExecutionContextScope *exe_scope,
+AddSymbolicInfo (const ExecutionContext *exe_ctx,
StreamString &comment,
uint64_t operand_value,
const Address &inst_addr)
{
Address so_addr;
Target *target = NULL;
- if (exe_scope)
- target = exe_scope->CalculateTarget();
+ if (exe_ctx)
+ target = exe_ctx->GetTargetPtr();
if (target && !target->GetSectionLoadList().IsEmpty())
{
if (target->GetSectionLoadList().ResolveLoadAddress(operand_value, so_addr))
- so_addr.Dump(&comment, exe_scope, Address::DumpStyleResolvedDescriptionNoModule, Address::DumpStyleSectionNameOffset);
+ so_addr.Dump (&comment,
+ exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL,
+ Address::DumpStyleResolvedDescriptionNoModule,
+ Address::DumpStyleSectionNameOffset);
}
else
{
@@ -126,7 +129,10 @@ AddSymbolicInfo (ExecutionContextScope *exe_scope,
if (module)
{
if (module->ResolveFileAddress(operand_value, so_addr))
- so_addr.Dump(&comment, exe_scope, Address::DumpStyleResolvedDescriptionNoModule, Address::DumpStyleSectionNameOffset);
+ so_addr.Dump (&comment,
+ exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL,
+ Address::DumpStyleResolvedDescriptionNoModule,
+ Address::DumpStyleSectionNameOffset);
}
}
}
@@ -166,7 +172,7 @@ InstructionLLVM::Dump
uint32_t max_opcode_byte_size,
bool show_address,
bool show_bytes,
- const lldb_private::ExecutionContext* exe_ctx,
+ const ExecutionContext* exe_ctx,
bool raw
)
{
@@ -336,7 +342,7 @@ InstructionLLVM::Dump
comment.Printf("0x%*.*llx ", addr_nibble_size, addr_nibble_size, operand_value);
}
- AddSymbolicInfo(exe_scope, comment, operand_value, GetAddress());
+ AddSymbolicInfo(exe_ctx, comment, operand_value, GetAddress());
} // EDEvaluateOperand
} // EDOperandIsMemory
} // EDGetOperand
@@ -365,7 +371,7 @@ InstructionLLVM::Dump
uint64_t operand_value = PC + atoi(++pos);
// Put the address value into the operands.
operands.Printf("0x%8.8llx ", operand_value);
- AddSymbolicInfo(exe_scope, comment, operand_value, GetAddress());
+ AddSymbolicInfo(exe_ctx, comment, operand_value, GetAddress());
}
}
// Yet more workaround for "bl #..." and "blx #...".
@@ -387,7 +393,7 @@ InstructionLLVM::Dump
llvm::StringRef Str(pos - 1);
RStrip(Str, '\n');
operands.PutCString(Str.str().c_str());
- AddSymbolicInfo(exe_scope, comment, operand_value, GetAddress());
+ AddSymbolicInfo(exe_ctx, comment, operand_value, GetAddress());
}
}
// END of workaround.
@@ -446,10 +452,9 @@ InstructionLLVM::CalculateMnemonicOperandsAndComment (ExecutionContextScope *exe
int currentOpIndex = -1;
StreamString comment;
uint32_t addr_nibble_size = 8;
- addr_t base_addr = LLDB_INVALID_ADDRESS;
- Target *target = NULL;
- if (exe_scope)
- target = exe_scope->CalculateTarget();
+ addr_t base_addr = LLDB_INVALID_ADDRESS;
+ ExecutionContext exe_ctx (exe_scope);
+ Target *target = exe_ctx.GetTargetPtr();
if (target && !target->GetSectionLoadList().IsEmpty())
base_addr = GetAddress().GetLoadAddress (target);
if (base_addr == LLDB_INVALID_ADDRESS)
@@ -501,7 +506,7 @@ InstructionLLVM::CalculateMnemonicOperandsAndComment (ExecutionContextScope *exe
if (!EDEvaluateOperand(&operand_value, operand, IPRegisterReader, &rra))
{
comment.Printf("0x%*.*llx ", addr_nibble_size, addr_nibble_size, operand_value);
- AddSymbolicInfo (exe_scope, comment, operand_value, GetAddress());
+ AddSymbolicInfo (&exe_ctx, comment, operand_value, GetAddress());
}
}
}
@@ -526,7 +531,7 @@ InstructionLLVM::CalculateMnemonicOperandsAndComment (ExecutionContextScope *exe
uint64_t operand_value = PC + atoi(++pos);
// Put the address value into the operands.
comment.Printf("0x%*.*llx ", addr_nibble_size, addr_nibble_size, operand_value);
- AddSymbolicInfo (exe_scope, comment, operand_value, GetAddress());
+ AddSymbolicInfo (&exe_ctx, comment, operand_value, GetAddress());
}
}
// Yet more workaround for "bl #..." and "blx #...".
@@ -551,7 +556,7 @@ InstructionLLVM::CalculateMnemonicOperandsAndComment (ExecutionContextScope *exe
// llvm::StringRef Str(pos - 1);
// RStrip(Str, '\n');
// operands.PutCString(Str.str().c_str());
- AddSymbolicInfo (exe_scope, comment, operand_value, GetAddress());
+ AddSymbolicInfo (&exe_ctx, comment, operand_value, GetAddress());
}
}
// END of workaround.
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
index 983f1671bc6..396a285aed6 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
@@ -630,14 +630,16 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto
lldb::StackFrameSP thread_cur_frame = thread.GetStackFrameAtIndex(0);
- Process *process = thread.CalculateProcess();
- const ABI *abi = process->GetABI().get();
+ const ABI *abi = NULL;
+ ProcessSP process_sp (thread.CalculateProcess());
+ if (process_sp)
+ abi = process_sp->GetABI().get();
if (abi == NULL)
return ret_plan_sp;
- Target *target = thread.CalculateTarget();
+ TargetSP target_sp (thread.CalculateTarget());
- ClangASTContext *clang_ast_context = target->GetScratchClangASTContext();
+ ClangASTContext *clang_ast_context = target_sp->GetScratchClangASTContext();
ValueList argument_values;
Value void_ptr_value;
lldb::clang_type_t clang_void_ptr_type = clang_ast_context->GetVoidPtrType(false);
@@ -671,9 +673,8 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto
if (!success)
return ret_plan_sp;
- ExecutionContext exe_ctx;
- thread.CalculateExecutionContext (exe_ctx);
-
+ ExecutionContext exe_ctx (thread.shared_from_this());
+ Process *process = exe_ctx.GetProcessPtr();
// isa_addr will store the class pointer that the method is being dispatched to - so either the class
// directly or the super class if this is one of the objc_msgSendSuper flavors. That's mostly used to
// look up the class/selector pair in our cache.
OpenPOWER on IntegriCloud