diff options
author | José Fonseca <jose.r.fonseca@gmail.com> | 2012-11-22 14:46:06 +0000 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2012-11-22 14:46:06 +0000 |
commit | 00611a483a0a531272ba5810b77fb5d293db1723 (patch) | |
tree | 34906f8aad5843bb1326b9d2c4fa852dbdb98c0c /retrace | |
parent | 529cf9b67e67bdd4cad619e1e9347134375d649d (diff) |
retrace: Dump call number on exceptions.
Diffstat (limited to 'retrace')
-rw-r--r-- | retrace/retrace_main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/retrace/retrace_main.cpp b/retrace/retrace_main.cpp index 27ff2b4d..a59ee9ae 100644 --- a/retrace/retrace_main.cpp +++ b/retrace/retrace_main.cpp @@ -545,6 +545,13 @@ longOptions[] = { {0, 0, 0, 0} }; + +static void exceptionCallback(void) +{ + std::cerr << retrace::callNo << ": error: caught an unhandled exception\n"; +} + + extern "C" int main(int argc, char **argv) { @@ -645,6 +652,8 @@ int main(int argc, char **argv) retrace::profiler.setup(retrace::profilingCpuTimes, retrace::profilingGpuTimes, retrace::profilingPixelsDrawn); } + os::setExceptionCallback(exceptionCallback); + for (i = optind; i < argc; ++i) { if (!retrace::parser.open(argv[i])) { return 1; @@ -654,6 +663,8 @@ int main(int argc, char **argv) retrace::parser.close(); } + + os::resetExceptionCallback(); // XXX: X often hangs on XCloseDisplay //retrace::cleanUp(); |