summaryrefslogtreecommitdiff
path: root/lldb/source/API/SBFunction.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2024-11-11 16:27:15 -0800
committerGitHub <noreply@github.com>2024-11-11 16:27:15 -0800
commitf109517d153609d4a8a3a3d3d3cc06da1b629364 (patch)
treead5ec7493427749fcbd5dc3a3f79da6941db6e5e /lldb/source/API/SBFunction.cpp
parentc280522f7e359117adde10de4158f9f6fec20a7b (diff)
[lldb] Support overriding the disassembly CPU & features (#115382)
Add the ability to override the disassembly CPU and CPU features through a target setting (`target.disassembly-cpu` and `target.disassembly-features`) and a `disassemble` command option (`--cpu` and `--features`). This is especially relevant for architectures like RISC-V which relies heavily on CPU extensions. The majority of this patch is plumbing the options through. I recommend looking at DisassemblerLLVMC and the test for the observable change in behavior.
Diffstat (limited to 'lldb/source/API/SBFunction.cpp')
-rw-r--r--lldb/source/API/SBFunction.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/API/SBFunction.cpp b/lldb/source/API/SBFunction.cpp
index 6a97352fc2c2..ac61220ec873 100644
--- a/lldb/source/API/SBFunction.cpp
+++ b/lldb/source/API/SBFunction.cpp
@@ -125,8 +125,9 @@ SBInstructionList SBFunction::GetInstructions(SBTarget target,
lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
const bool force_live_memory = true;
sb_instructions.SetDisassembler(Disassembler::DisassembleRange(
- module_sp->GetArchitecture(), nullptr, flavor, *target_sp,
- m_opaque_ptr->GetAddressRange(), force_live_memory));
+ module_sp->GetArchitecture(), nullptr, flavor,
+ target_sp->GetDisassemblyCPU(), target_sp->GetDisassemblyFeatures(),
+ *target_sp, m_opaque_ptr->GetAddressRange(), force_live_memory));
}
}
return sb_instructions;