about summary refs log tree commit diff
path: root/src/libstd/sys/unix/backtrace/mod.rs
AgeCommit message (Collapse)AuthorLines
2019-05-25std: Depend on `backtrace` crate from crates.ioAlex Crichton-110/+0
This commit removes all in-tree support for generating backtraces in favor of depending on the `backtrace` crate on crates.io. This resolves a very longstanding piece of duplication where the standard library has long contained the ability to generate a backtrace on panics, but the code was later extracted and duplicated on crates.io with the `backtrace` crate. Since that fork each implementation has seen various improvements one way or another, but typically `backtrace`-the-crate has lagged behind libstd in one way or another. The goal here is to remove this duplication of a fairly critical piece of code and ensure that there's only one source of truth for generating backtraces between the standard library and the crate on crates.io. Recently I've been working to bring the `backtrace` crate on crates.io up to speed with the support in the standard library which includes: * Support for `StackWalkEx` on MSVC to recover inline frames with debuginfo. * Using `libbacktrace` by default on MinGW targets. * Supporting `libbacktrace` on OSX as an option. * Ensuring all the requisite support in `backtrace`-the-crate compiles with `#![no_std]`. * Updating the `libbacktrace` implementation in `backtrace`-the-crate to initialize the global state with the correct filename where necessary. After reviewing the code in libstd the `backtrace` crate should be at exact feature parity with libstd today. The backtraces generated should have the same symbols and same number of frames in general, and there's not known divergence from libstd currently. Note that one major difference between libstd's backtrace support and the `backtrace` crate is that on OSX the crates.io crate enables the `coresymbolication` feature by default. This feature, however, uses private internal APIs that aren't published for OSX. While they provide more accurate backtraces this isn't appropriate for libstd distributed as a binary, so libstd's dependency on the `backtrace` crate explicitly disables this feature and forces OSX to use `libbacktrace` as a symbolication strategy. The long-term goal of this refactoring is to eventually move us towards a world where we can drop `libbacktrace` entirely and simply use Gimli and the surrounding crates for backtrace support. That's still aways off but hopefully will much more easily enabled by having the source of truth for backtraces live in crates.io! Procedurally if we go forward with this I'd like to transfer the `backtrace-rs` crate to the rust-lang GitHub organization as well, but I figured I'd hold off on that until we get closer to merging.
2019-02-28libstd => 2018Taiki Endo-4/+5
2018-12-25Remove licensesMark Rousskov-10/+0
2017-09-02Use env::current_exe for libbacktrace on macOSJohn Colanduoni-20/+7
2017-09-02Add libbacktrace support for Apple platformsJohn Colanduoni-1/+28
2017-03-12Update usages of 'OSX' (and other old names) to 'macOS'.Corey Farwell-4/+4
As of last year with version 'Sierra', the Mac operating system is now called 'macOS'.
2017-02-15Improve backtrace formating while panicking.Yamakaky-1/+4
- `RUST_BACKTRACE=full` prints all the informations (old behaviour) - `RUST_BACKTRACE=(0|no)` disables the backtrace. - `RUST_BACKTRACE=<everything else>` (including `1`) shows a simplified backtrace, without the function addresses and with cleaned filenames and symbols. Also removes some unneded frames at the beginning and the end. Fixes #37783. PR is #38165.
2017-01-28Use libc::c_char instead of i8 due to platforms with unsigned charSegev Finer-1/+2
2017-01-27Attempt at fixing dead code lintsSegev Finer-5/+8
2017-01-24Make backtraces work on Windows GNU targets again.Segev Finer-0/+7
This is done by adding a function that can return a filename to pass to backtrace_create_state. The filename is obtained in a safe way by first getting the filename, locking the file so it can't be moved, and then getting the filename again and making sure it's the same. See: https://github.com/rust-lang/rust/pull/37359#issuecomment-260123399 Issue: #33985
2015-09-04Add line numbers to windows-gnu backtracesDiggory Blake-29/+0
Fix formatting Remove unused imports Refactor Fix msvc build Fix line lengths Formatting Enable backtrace tests Fix using directive on mac pwd info Work-around buildbot PWD bug, and fix libbacktrace configuration Use alternative to `env -u` which is not supported on bitrig Disable tests on 32-bit windows gnu
2015-08-22Fix the Mac build, again.Richard Diamond-0/+1
2015-08-20Refactor unix backtracing. NFC.Richard Diamond-0/+119