Open
Description
In lldb
, we are using hardcoded encodings in different places:
lldb/source/Host/common/NativeProcessProtocol.cpp
: inNativeProcessProtocol::GetSoftwareBreakpointTrapOpcode
,g_dpu_opcode
is thebkp
encodinglldb/scripts/dpu/dpu_commands.py
: indpu_attach_on_boot
, we write thebkp
encoding to memorylldb/source/Plugins/Process/Dpu/Dpu.cpp
:- in
Dpu::Boot
,breakpoint_instruction
is thebkp
encoding - in
Dpu::GetThreadState
, we check whetherprev_instruction
is thefault 1
encoding
- in
lldb/source/Plugins/Process/Utility/RegisterContextDPU.cpp
: inRegisterContextDPU::PCIsInstructionReturn
we check whetherinstruction
is thejump r23
encoding
This is mainly an issue when changing the ISA, which does not happen every week. However, when it happens, fixing some lldb
issues may become harder than needed.
I think we should at least place all these encodings in a single place (per language), which will make it easier to change these values. Ideally we can imagine to generate these files from the metasm
module.