[Lldb-commits] [lldb] [lldb-dap] persistent assembly breakpoints (PR #148061)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Jul 15 09:45:58 PDT 2025
jimingham wrote:
> From the issue, we can have persistent assembly source breakpoint if it is set from the disassembly view.
>
> We only create sourceReference and virtual disassembly file if there is no source file for that frame.
>
> we can store the necessary information in the adapter data to recreate an instruction break-point and handle it like an instruction break-point.
>
> Relevant Infographic.
>
> <img alt="image" width="2000" height="1486" src="https://private-user-images.githubusercontent.com/57949090/466522246-ce8aec05-7a0e-4bec-bbd8-413d33424515.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTI1OTc1MDksIm5iZiI6MTc1MjU5NzIwOSwicGF0aCI6Ii81Nzk0OTA5MC80NjY1MjIyNDYtY2U4YWVjMDUtN2EwZS00YmVjLWJiZDgtNDEzZDMzNDI0NTE1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA3MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNzE1VDE2MzMyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRhZTMzZWEzMTg4MzQzNjNlZWE3MzcyMDk3ZTUwODBlZGRiMGM2ZGM5ODlmZTRkODM3MjNiYjJmZjQzMmFmZWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.X8QS415Rnn061oyM6j-wmH7351akX4V1yTXZY68Th0E">
>From the infographic, you clearly know what address you want to set the breakpoint on. If the SBModule was also known at the point where you are setting the breakpoint, you could make an SBAddress from the module and file offset and set the breakpoint with `SBTarget::BreakpointCreateBySBAddress`.
But if you want to set a file address offset for a module that isn't loaded yet, then you do need:
SBTarget::BreakpointCreateByFileAddress(SBModuleSpec module_spec, lldb:addr_t file_offset);
You should in this case use a ModlueSpec, not a FileSpec, both because it makes clear that you are looking for a Module and not a source file, for instance. Also, there's no reason you couldn't specify the Module you are seeking by UUID (in fact, if you are setting file offset breakpoint you really do want to make sure this is the build of the binary you expect - we really try to make as safe as possible the random insertion of traps into the binary.)
But I still don't see the need for the additional `offset` and `instruction offset` parameters here.
https://github.com/llvm/llvm-project/pull/148061
More information about the lldb-commits
mailing list