codelldb
codelldb copied to clipboard
Rust: not stopping on some breakpoints
OS: Ubuntu 20.04 VSCode version: 1.49.2 Extension version: 1.5.3 Toolchain version: rustc 1.46.0 (04488afe3 2020-08-24) Build target: stable-x86_64-unknown-linux-gnu (default) Python version: Python 3.8.2
Debugger does not stop on the breakpoints in some methods. The method gets ran and it prints the dbg! statement.
In this statement I do a method call self.peeked[self.write_index] = self.lexer.next()?; but the breakpoint inside self.lexer.next()? method does not trigger.
When going line by line I can sometimes step into that method but sometimes I step into following Rust's libcore method instead:
/// Notice that the compiler performs this copy automatically when dropping packed structs,
/// i.e., you do not usually have to worry about such issues unless you call `drop_in_place`
/// manually.
#[stable(feature = "drop_in_place", since = "1.8.0")]
#[lang = "drop_in_place"]
#[allow(unconditional_recursion)]
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
// Code here does not matter - this is replaced by the
// real drop glue by the compiler.
// SAFETY: see comment above
unsafe { drop_in_place(to_drop) }
}
If I continue to step-in from that it immediately throws me out to the caller, as if the call completed.
On odd step-in attempts (the first one) it steps into the correct method, on even attempts it steps into Rust's method.
For the exact example you can clone https://github.com/boa-dev/boa repository, create a target with cargo run --bin boa, put a breakpoint at this line (specific commit), and run debug with configuration named "Launch":
https://github.com/boa-dev/boa/blob/a77ceb67fd6bbb419758f735cbf3bfb37703790a/boa/src/syntax/parser/cursor/buffered_lexer/mod.rs#L126