sim: Add support for generating back traces on errors
Review Request #3221 - Created Nov. 15, 2015 and submitted
| Information | |
|---|---|
| Andreas Sandberg | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 11212:9726e0e72bef --------------------------- sim: Add support for generating back traces on errors Add functionality to generate a back trace if gem5 crashes (SIGABRT or SIGSEGV). The current implementation uses glibc's stack traversal support if available and stubs out the call to print_backtrace() otherwise.
Tested on both MacOS and Linux by provoking aborts and segmentation faults. Compiled with both clang and GCC.
This is cool. I've had my own hacky version of this for a while, and it's been really useful. Thanks for submitting!
Just minor notes below.
-
src/sim/backtrace_glibc.cc (Diff revision 1) -
Can we lift SAFE_MSG into backtrace.hh maybe, so there is only one copy of it?
-
src/sim/init_signals.cc (Diff revision 1) -
Should this return an exit code consistent with the signal that was raised (e.g. SIGSEGV = 139)? Someone may have scripts that handle simulator error codes, and hard coding here might make them inconsistent. Or maybe it's better that this is unique, since it looks like a strange place to exit?
Description: |
|
|||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+286 -19) |
Ship It!
