mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-02 03:56:42 +00:00
nova: re-throw uncatched exception of dying thread
If the re-throw works, we will can see which exception type was thrown.
This commit is contained in:
parent
973d710101
commit
2c3a0bbe1b
@ -37,26 +37,25 @@ void Thread_base::_thread_start()
|
|||||||
{
|
{
|
||||||
using namespace Genode;
|
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 {
|
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 {
|
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);
|
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();
|
throw;
|
||||||
|
|
||||||
} catch (...) {
|
|
||||||
/* die in a noisy way */
|
|
||||||
nova_die();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Thread_base::myself()->_join_lock.unlock();
|
||||||
|
|
||||||
/* sleep silently */
|
/* sleep silently */
|
||||||
Genode::sleep_forever();
|
Genode::sleep_forever();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user