diff options
author | anonymous <local@localhost> | 2010-09-29 23:20:49 +0000 |
---|---|---|
committer | anonymous <local@localhost> | 2010-09-29 23:20:58 +0000 |
commit | a283c64f6b95ec2db1b4b6004f27b1e448961e73 (patch) | |
tree | 01d89942a1ba29a1ce64127911bdf978d80cef87 /src/exception.cc | |
parent | becd5d8b40af38d97134dfb491f109e0d1688976 (diff) | |
download | libcxxrt-a283c64f6b95ec2db1b4b6004f27b1e448961e73.tar.gz libcxxrt-a283c64f6b95ec2db1b4b6004f27b1e448961e73.tar.bz2 libcxxrt-a283c64f6b95ec2db1b4b6004f27b1e448961e73.tar.xz |
Add __cxa_demangle support
Diffstat (limited to 'src/exception.cc')
-rw-r--r-- | src/exception.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/exception.cc b/src/exception.cc index 749f743..0ecc679 100644 --- a/src/exception.cc +++ b/src/exception.cc @@ -443,18 +443,17 @@ static void report_failure(_Unwind_Reason_Code err, void *thrown_exception) fprintf(stderr, "Fatal error during phase 2 unwinding\n"); break; case _URC_END_OF_STACK: - fprintf(stderr, "Terminating due to uncaught exception %p:\n", + fprintf(stderr, "Terminating due to uncaught exception %p", thrown_exception); -/* TODO: Uncomment this when __cxa_demangle() is implemented. size_t bufferSize = 128; char *demangled = (char*)malloc(bufferSize); const char *mangled = __cxa_current_exception_type()->name(); int status; __cxa_demangle(mangled, demangled, &bufferSize, &status); - fprintf(stderr, "Terminating due to uncaught of type %s:\n", + fprintf(stderr, " of type %s\n", status == 0 ? (const char*)demangled : mangled); -*/ + if (status == 0) { free(demangled); } // Print a back trace if no handler is found. // TODO: Make this optional _Unwind_Backtrace(trace, 0); |