gdb: defer commit resume until all available events are consumed
[deliverable/binutils-gdb.git] / gdb / inferior.h
index 572c5f3ae72dcf5e571a7a1433f668846b29e961..606cece6c0b33a017d9cfb759a88a8cf007309fb 100644 (file)
@@ -21,6 +21,8 @@
 #if !defined (INFERIOR_H)
 #define INFERIOR_H 1
 
+#include <exception>
+
 struct target_waitstatus;
 struct frame_info;
 struct ui_file;
@@ -80,7 +82,13 @@ struct infcall_suspend_state_deleter
        /* If we are restoring the inferior state due to an exception,
           some error message will be printed.  So, only warn the user
           when we cannot restore during normal execution.  */
-       if (!std::uncaught_exception ())
+       bool unwinding;
+#if __cpp_lib_uncaught_exceptions
+       unwinding = std::uncaught_exceptions () > 0;
+#else
+       unwinding = std::uncaught_exception ();
+#endif
+       if (!unwinding)
          warning (_("Failed to restore inferior state: %s"), e.what ());
       }
   }
This page took 0.023184 seconds and 4 git commands to generate.