Skip to content

Commit

Permalink
[EXPERIMENTAL] Try needs-unwind
Browse files Browse the repository at this point in the history
  • Loading branch information
jieyouxu committed Mar 23, 2024
1 parent f85a455 commit 1a3a3df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/ui/debuginfo/backtrace-line-tables-only.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//@ ignore-windows
//@ run-pass
//@ compile-flags: -Cdebuginfo=line-tables-only
//@ needs-unwind
#![feature(backtrace_frames)]

use std::backtrace::{self, Backtrace};
Expand Down Expand Up @@ -32,7 +33,6 @@ fn assert_contains(
// FIXME(jieyouxu): fix this ugly fragile test when `BacktraceFrame` has accessors like...
// `symbols()`.
let backtrace = format!("{:#?}", backtrace);
eprintln!("{}", backtrace);
assert!(backtrace.contains(expected_name), "backtrace does not contain expected name {}", expected_name);
assert!(backtrace.contains(expected_file), "backtrace does not contain expected file {}", expected_file);
assert!(backtrace.contains(&expected_line.to_string()), "backtrace does not contain expected line {}", expected_line);
Expand All @@ -50,6 +50,7 @@ fn main() {
let mut backtrace: Option<Backtrace> = None;
unsafe { line_tables_only_foo(store_backtrace, addr_of_mut!(backtrace).cast::<c_void>()) };
let backtrace = backtrace.expect("backtrace");
eprintln!("{:#?}", backtrace);
assert_contains(&backtrace, "line_tables_only_foo", "rust_test_helpers.c", 435);
assert_contains(&backtrace, "line_tables_only_bar", "rust_test_helpers.c", 439);
assert_contains(&backtrace, "line_tables_only_baz", "rust_test_helpers.c", 443);
Expand Down

0 comments on commit 1a3a3df

Please sign in to comment.