From 2c3a0bbe1b951b1b5e28b56142033ea6fbb1341e Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Fri, 16 May 2014 10:27:24 +0200 Subject: [PATCH] nova: re-throw uncatched exception of dying thread If the re-throw works, we will can see which exception type was thrown. --- .../base-nova/src/base/thread/thread_nova.cc | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/repos/base-nova/src/base/thread/thread_nova.cc b/repos/base-nova/src/base/thread/thread_nova.cc index de509f099..941d834b6 100644 --- a/repos/base-nova/src/base/thread/thread_nova.cc +++ b/repos/base-nova/src/base/thread/thread_nova.cc @@ -37,26 +37,25 @@ void Thread_base::_thread_start() { using namespace Genode; - /* if the inner catch handling fails, let thread die with some noise */ + /* catch any exception at this point and try to print an error message */ try { + Thread_base::myself()->entry(); + } catch (...) { + char thread_name[48]; + Thread_base::myself()->name(thread_name, sizeof(thread_name)); - /* catch any exception at this point and try to print a error message */ try { - Thread_base::myself()->entry(); - } catch (...) { - char thread_name[48]; - Thread_base::myself()->name(thread_name, sizeof(thread_name)); - PERR("Thread '%s' died because of an uncaught exception", thread_name); + } catch (...) { + /* die in a noisy way */ + nova_die(); } - Thread_base::myself()->_join_lock.unlock(); - - } catch (...) { - /* die in a noisy way */ - nova_die(); + throw; } + Thread_base::myself()->_join_lock.unlock(); + /* sleep silently */ Genode::sleep_forever(); }