Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you create a breakpoint? #36

Open
JonathanWoollett-Light opened this issue Oct 30, 2024 · 2 comments
Open

How do you create a breakpoint? #36

JonathanWoollett-Light opened this issue Oct 30, 2024 · 2 comments

Comments

@JonathanWoollett-Light
Copy link

JonathanWoollett-Light commented Oct 30, 2024

In lldb-sys this can be done with:

use lldb_sys::*;
const BINARY: &str = env!("CARGO_BIN_EXE_testing");
SBDebuggerInitialize();
let debugger = SBDebuggerCreate2(true);
let binary_path = CString::new(BINARY)?;
let target = SBDebuggerCreateTarget2(debugger, binary_path.as_ptr());
let file = CString::new("src/main.rs")?;
let breakpoint = SBTargetBreakpointCreateByLocation(target, file.as_ptr(), 1);

so I would assume SBTargetBreakpointCreateByLocation would be a function on lldb::SBTarget but I can't see any.

@waywardmonkeys
Copy link
Contributor

If I remember correctly, I didn't add that yet ... a PR would be welcome! There's a whole bunch of similar functions though, so we only need to add the ones that are actually necessary (not older API).

@anatawa12
Copy link
Contributor

In my program, I added BreakPoint by finding symbol with SBTarget::find_symbols and then I created breakpoint with SBTarget::breakpoint_create_by_sbaddress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants