rust/tests/debuginfo/multiline-calls.rs
Kyle Huey caf665e692 Use the fn_span when emitting function calls for better debug info.
This especially improves the developer experience for long chains
of function calls that span multiple lines, which is common with
builder patterns, chains of iterator/future combinators, etc.
2025-05-22 14:06:24 -07:00

36 lines
721 B
Rust

//@ compile-flags:-g
//@ min-gdb-version: 16.0
// === GDB TESTS ===================================================================================
// gdb-command: run
// gdb-check:[...]#break[...]
// gdb-command: up
// gdb-check:[...]zzz[...]
// === LLDB TESTS ==================================================================================
// lldb-command:run
// lldb-check:[...]#break[...]
// lldb-command: up
// lldb-check:[...]zzz[...]
struct Foo;
impl Foo {
fn bar(self) -> Foo {
println!("bar");
self
}
fn baz(self) -> Foo {
println!("baz"); // #break
self
}
}
fn main() {
let f = Foo;
f.bar() // aaa
.baz(); // zzz
}