From 6765e5c94ba44895c5607c3e6d62f89ea6402262 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Tue, 11 Jul 2023 15:09:10 +0200 Subject: [PATCH] Attach debugger after printing failure information --- libs/pika/runtime/src/runtime_handlers.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/pika/runtime/src/runtime_handlers.cpp b/libs/pika/runtime/src/runtime_handlers.cpp index 00c844a31..d3989ab09 100644 --- a/libs/pika/runtime/src/runtime_handlers.cpp +++ b/libs/pika/runtime/src/runtime_handlers.cpp @@ -56,8 +56,6 @@ namespace pika::detail { handling_assertion = true; - pika::util::may_attach_debugger("exception"); - std::ostringstream strm; strm << "Assertion '" << expr << "' failed"; if (!msg.empty()) @@ -69,6 +67,9 @@ namespace pika::detail { std::cerr << pika::diagnostic_information(pika::detail::get_exception( e, loc.function_name, loc.file_name, loc.line_number)) << std::endl; + + pika::util::may_attach_debugger("exception"); + std::abort(); }