diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2024-11-11 16:27:15 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-11 16:27:15 -0800 |
| commit | f109517d153609d4a8a3a3d3d3cc06da1b629364 (patch) | |
| tree | ad5ec7493427749fcbd5dc3a3f79da6941db6e5e /lldb/source/Expression/IRExecutionUnit.cpp | |
| parent | c280522f7e359117adde10de4158f9f6fec20a7b (diff) | |
| download | llvm-f109517d153609d4a8a3a3d3d3cc06da1b629364.tar.gz llvm-f109517d153609d4a8a3a3d3d3cc06da1b629364.tar.bz2 llvm-f109517d153609d4a8a3a3d3d3cc06da1b629364.zip | |
[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/Expression/IRExecutionUnit.cpp')
| -rw-r--r-- | lldb/source/Expression/IRExecutionUnit.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp index 7bee183d2ff2..9158b43b1c5c 100644 --- a/lldb/source/Expression/IRExecutionUnit.cpp +++ b/lldb/source/Expression/IRExecutionUnit.cpp @@ -167,8 +167,10 @@ Status IRExecutionUnit::DisassembleFunction(Stream &stream, const char *plugin_name = nullptr; const char *flavor_string = nullptr; - lldb::DisassemblerSP disassembler_sp = - Disassembler::FindPlugin(arch, flavor_string, plugin_name); + const char *cpu_string = nullptr; + const char *features_string = nullptr; + lldb::DisassemblerSP disassembler_sp = Disassembler::FindPlugin( + arch, flavor_string, cpu_string, features_string, plugin_name); if (!disassembler_sp) { ret = Status::FromErrorStringWithFormat( |
