mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-27 15:14:31 +00:00
[lldb] s/ExecutionContext/Target in Disassembler
Some functions in this file only use the "target" component of an execution context. Adjust the argument lists to reflect that. This avoids some defensive null checks and simplifies most of the callers.
This commit is contained in:
1 parent
29693fc125
commit
04592d5b23
10 files changed
+48
-66
No files matched your search
@@ -126,20 +126,15 @@ SBInstructionList SBFunction::GetInstructions(SBTarget target,
|
||||
|
||||
SBInstructionList sb_instructions;
|
||||
if (m_opaque_ptr) {
|
||||
ExecutionContext exe_ctx;
|
||||
TargetSP target_sp(target.GetSP());
|
||||
std::unique_lock<std::recursive_mutex> lock;
|
||||
if (target_sp) {
|
||||
lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
|
||||
target_sp->CalculateExecutionContext(exe_ctx);
|
||||
exe_ctx.SetProcessSP(target_sp->GetProcessSP());
|
||||
}
|
||||
ModuleSP module_sp(
|
||||
m_opaque_ptr->GetAddressRange().GetBaseAddress().GetModule());
|
||||
if (module_sp) {
|
||||
if (target_sp && module_sp) {
|
||||
lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
|
||||
const bool prefer_file_cache = false;
|
||||
sb_instructions.SetDisassembler(Disassembler::DisassembleRange(
|
||||
module_sp->GetArchitecture(), nullptr, flavor, exe_ctx,
|
||||
module_sp->GetArchitecture(), nullptr, flavor, *target_sp,
|
||||
m_opaque_ptr->GetAddressRange(), prefer_file_cache));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user