[Lldb-commits] [lldb] [lldb-dap] persistent assembly breakpoints (PR #148061)
Ely Ronnen via lldb-commits
lldb-commits at lists.llvm.org
Wed Jul 16 14:54:20 PDT 2025
eronnen wrote:
@jimingham
I don't know if the `instructions_offset` parameter can be useful for other use cases, but in order to resolve assembly breakpoints in future sessions under the given protocol constraints I don't see another way .
In the Debug Adapter Protocol the only persistent data that is saved for a breakpoint is its line number and its `Source`, where a `Source` represents a function in a module. For assembly breakpoints the "line number" is the number of instructions from the start of the function until the breakpoint address (like you would see in a disassembly view).
Therefore, in order to resolve an assembly breakpoint in a future session, where all the available data is the `Source` (which is moudle+function) and the line number - After resolving the module and the function I'll have to add a certain offset in order to get to the desired breakpoint address, and I cannot use the existing raw bytes `offset` parameter that the `BreakpointResolver` class has, because in some architectures the instruction size is not constant. So in order to handle that I will have to disassemble from the start of the function in order to see what offset equals the "line number" in the given function.
https://github.com/llvm/llvm-project/pull/148061
More information about the lldb-commits
mailing list