From 00611a483a0a531272ba5810b77fb5d293db1723 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 22 Nov 2012 14:46:06 +0000 Subject: retrace: Dump call number on exceptions. --- retrace/retrace_main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'retrace/retrace_main.cpp') 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(); -- cgit v1.2.3