cxx: report names of uncaught exceptions again

Fixes #1582
This commit is contained in:
Christian Prochaska
2015-06-15 14:53:15 +02:00
committed by Christian Helmuth
parent 1f62446b65
commit 4cae6c0d12
2 changed files with 34 additions and 2 deletions

View File

@ -12,6 +12,12 @@
* under the terms of the GNU General Public License version 2.
*/
/* libsupc++ includes */
#include <cxxabi.h>
/* Genode includes */
#include <base/printf.h>
extern "C" char __eh_frame_start__[]; /* from linker script */
extern "C" void __register_frame (const void *begin); /* from libgcc_eh */
@ -33,6 +39,28 @@ extern "C" int dl_iterate_phdr(int (*callback) (void *info, unsigned long size,
extern "C" int dl_iterate_phdr(int (*callback) (void *info, unsigned long size, void *data), void *data) {
return -1; }
void init_exception_handling() {
__register_frame(__eh_frame_start__); }
/*
* Terminate handler
*/
void terminate_handler()
{
std::type_info *t = __cxxabiv1::__cxa_current_exception_type();
if (t)
PERR("Uncaught exception of type '%s' (use 'c++filt -t' to demangle)",
t->name());
}
/*
* Initialization
*/
void init_exception_handling()
{
__register_frame(__eh_frame_start__);
std::set_terminate(terminate_handler);
}