backtrace

What is RUST_BACKTRACE supposed to tell me?

◇◆丶佛笑我妖孽 提交于 2021-02-09 12:50:35
问题 My program is panicking so I followed its advice to run RUST_BACKTRACE=1 and I get this (just a little snippet). 1: 0x800c05b5 - std::sys::imp::backtrace::tracing::imp::write::hf33ae72d0baa11ed at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42 2: 0x800c22ed - std::panicking::default_hook::{{closure}}::h59672b733cc6a455 at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:351 If the program

What is RUST_BACKTRACE supposed to tell me?

时间秒杀一切 提交于 2021-02-09 12:48:55
问题 My program is panicking so I followed its advice to run RUST_BACKTRACE=1 and I get this (just a little snippet). 1: 0x800c05b5 - std::sys::imp::backtrace::tracing::imp::write::hf33ae72d0baa11ed at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42 2: 0x800c22ed - std::panicking::default_hook::{{closure}}::h59672b733cc6a455 at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:351 If the program

What is RUST_BACKTRACE supposed to tell me?

做~自己de王妃 提交于 2021-02-09 12:46:00
问题 My program is panicking so I followed its advice to run RUST_BACKTRACE=1 and I get this (just a little snippet). 1: 0x800c05b5 - std::sys::imp::backtrace::tracing::imp::write::hf33ae72d0baa11ed at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42 2: 0x800c22ed - std::panicking::default_hook::{{closure}}::h59672b733cc6a455 at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:351 If the program

Getting the caller's Return Address

我们两清 提交于 2021-02-07 13:37:44
问题 I am trying to figure out how to grab the return address of a caller in MSVC. I can use _ReturnAddress() to get the return address of my function, but I can't seem to find a way to get the caller's. I've tried using CaptureStackBackTrace, but for some reason, it crashes after many, many calls. I would also prefer a solution via inline assembly. void my_function(){ cout << "return address of caller_function: " << [GET CALLER'S RETURN VALUE]; } // imaginary return address: 0x15AF7C0 void caller

Wrong line numbers from addr2line

人盡茶涼 提交于 2021-02-04 10:40:28
问题 I try to find the exact line of a call in the backtrace in C++ program. Right now I am using these lines (from the man page of backtrace) to get the trace: void *bt_buffer[1000]; char **bt_strings; int bt_nptrs = backtrace(bt_buffer, 1000); bt_strings = backtrace_symbols(bt_buffer, bt_nptrs); In bt_strings I find lines of the form ./prog() [0x402e42] Now I take the address (the hex string) and feed it to addr2line. That sometimes results in apparently wrong line numbers. Internet search led

Is it possible to print a backtrace in Rust without panicking?

情到浓时终转凉″ 提交于 2020-05-23 08:38:48
问题 Is it possible to print a backtrace (assuming RUST_BACKTRACE is enabled) without panicking? It seems that the only way of doing that is calling via panic! . If not, is there a reason for it? 回答1: Rust uses the backtrace crate to print the backtrace in case of panics (has been merged in PR #60852). A simple example can be found in the crate documentation use backtrace::Backtrace; fn main() { let bt = Backtrace::new(); // do_some_work(); println!("{:?}", bt); } which gives for example stack

Why does PHPUnit hide my xdebug backtrace?

混江龙づ霸主 提交于 2020-01-19 13:10:00
问题 I have PHPUnit and xdebug installed, and in my php.ini files for CLI I've got: display_errors = On xdebug.default_enable = 1 I've verified that an xdebug backtrace is printed when I create an error using the interactive console, but when an error occurs while running phpunit, there is no backtrace? What is happening to the backtrace? Is phpunit hiding it from me? Is there some setting I'm missing? Thanks! 回答1: What is happening to the backtrace? Is phpunit hiding it from me? Yes, PHPUnit