In lldb, we are using hardcoded encodings in different places:
lldb/source/Host/common/NativeProcessProtocol.cpp: in NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode, g_dpu_opcode is the bkp encoding
lldb/scripts/dpu/dpu_commands.py: in dpu_attach_on_boot, we write the bkp encoding to memory
lldb/source/Plugins/Process/Dpu/Dpu.cpp:
- in
Dpu::Boot, breakpoint_instruction is the bkp encoding
- in
Dpu::GetThreadState, we check whether prev_instruction is the fault 1 encoding
lldb/source/Plugins/Process/Utility/RegisterContextDPU.cpp: in RegisterContextDPU::PCIsInstructionReturn we check whether instruction is the jump 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.
In
lldb, we are using hardcoded encodings in different places:lldb/source/Host/common/NativeProcessProtocol.cpp: inNativeProcessProtocol::GetSoftwareBreakpointTrapOpcode,g_dpu_opcodeis thebkpencodinglldb/scripts/dpu/dpu_commands.py: indpu_attach_on_boot, we write thebkpencoding to memorylldb/source/Plugins/Process/Dpu/Dpu.cpp:Dpu::Boot,breakpoint_instructionis thebkpencodingDpu::GetThreadState, we check whetherprev_instructionis thefault 1encodinglldb/source/Plugins/Process/Utility/RegisterContextDPU.cpp: inRegisterContextDPU::PCIsInstructionReturnwe check whetherinstructionis thejump r23encodingThis is mainly an issue when changing the ISA, which does not happen every week. However, when it happens, fixing some
lldbissues 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
metasmmodule.