From c4adc6d6aa772cb9b8e5dc294bbdc75b4e22f38d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 1 Apr 2017 11:33:11 +0200 Subject: Redo handling of unhandled exceptions in async execution Here is the problem: noexcept looses the call stack. That is, unlike an unhandled exception, if noexcept is tripped, then you won't see the place where it was thrown. In this new implementation we now have noexcept only on the task thunk. And the task is called via a thunk only in case of async execution. This means that if we are executing serially (-j 1), then this will be an unhandled exception, not noexcept. Hopefully will be a bit easier to debug. --- build2/test/script/parser.cxx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'build2/test/script/parser.cxx') diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx index d6d77fe..350ca44 100644 --- a/build2/test/script/parser.cxx +++ b/build2/test/script/parser.cxx @@ -2868,7 +2868,7 @@ namespace build2 } static void - execute_impl (scope& s, script& scr, runner& r) noexcept + execute_impl (scope& s, script& scr, runner& r) { try { @@ -2879,13 +2879,6 @@ namespace build2 { s.state = scope_state::failed; } - catch (const std::exception& e) - { - diag_lock l; - *diag_stream << "unhandled exception: " << e << endl; - assert (false); - abort (); - } } void parser:: @@ -3007,7 +3000,7 @@ namespace build2 [] (scope& s, script& scr, runner& r, - const diag_frame* ds) noexcept + const diag_frame* ds) { diag_frame df (ds); execute_impl (s, scr, r); -- cgit v1.1