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

@ -1,5 +1,8 @@
CXX_SRC_CC += misc.cc new_delete.cc malloc_free.cc exception.cc guard.cc unwind.cc
# We need the libsupc++ include directory
STDINC = yes
vpath %.cc $(BASE_DIR)/src/base/cxx
#
@ -51,6 +54,7 @@ REDEF_SYMBOLS = $(foreach S, $(EH_SYMBOLS), --redefine-sym $(S)=_cxx_$(S) --rede
KEEP_SYMBOLS += __cxa_guard_acquire
KEEP_SYMBOLS += __dynamic_cast
KEEP_SYMBOLS += __cxa_throw_bad_array_new_length
KEEP_SYMBOLS += __cxa_current_exception_type
KEEP_SYMBOLS += _ZTVN10__cxxabiv116__enum_type_infoE
KEEP_SYMBOLS += _ZN10__cxxabiv121__vmi_class_type_infoD0Ev
KEEP_SYMBOLS += _ZTVN10__cxxabiv119__pointer_type_infoE

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);
}