Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic backtrace functionality #12602

Merged
merged 2 commits into from
Mar 13, 2014
Merged

Commits on Mar 12, 2014

  1. Bundle libbacktrace with the compiler

    This will soon be used to print backtraces on failure
    alexcrichton committed Mar 12, 2014
    Configuration menu
    Copy the full SHA
    9a21b90 View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2014

  1. Add basic backtrace functionality

    Whenever a failure happens, if a program is run with
    `RUST_LOG=std::rt::backtrace` a backtrace will be printed to the task's stderr
    handle. Stack traces are uncondtionally printed on double-failure and
    rtabort!().
    
    This ended up having a nontrivial implementation, and here's some highlights of
    it:
    
    * We're bundling libbacktrace for everything but OSX and Windows
    * We use libgcc_s and its libunwind apis to get a backtrace of instruction
      pointers
    * On OSX we use dladdr() to go from an instruction pointer to a symbol
    * On unix that isn't OSX, we use libbacktrace to get symbols
    * Windows, as usual, has an entirely separate implementation
    
    Lots more fun details and comments can be found in the source itself.
    
    Closes rust-lang#10128
    alexcrichton committed Mar 13, 2014
    5 Configuration menu
    Copy the full SHA
    829df69 View commit details
    Browse the repository at this point in the history