Background: In Rust, you typically have multiple source files called mod.rs
. For example:
app_name
src
main.rs
foo
mod.rs
bar
mod.rs
Problem: I can't find a way to distinguish one mod.rs
from another when setting an LLDB breakpoint:
$ cargo build
$ rust-lldb target/debug/app_name
(lldb) breakpoint set -f mod.rs -l 10
Breakpoint 1: 2 locations.
(lldb) breakpoint set -f foo/mod.rs -l 10
Breakpoint 2: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) breakpoint set -f src/foo/mod.rs -l 10
Breakpoint 3: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
This issue arises most commonly with mod.rs
. More generally, it arises anytime multiple source files share the same name.
Question: Is there a way to set a breakpoint at line 10 of foo/mod.rs
but not at line 10 of bar/mod.rs
?