This commit contains QUIT processing updates for GDB's Guile support.
As with the Python updates, we don't want to permit this code to
swallow the exception, gdb_exception_forced_quit, which is associated
with GDB receiving a SIGTERM.
I've adopted the same solution that I used for Python; whereever
a gdb_exception is caught in try/catch code in the Guile extension
language support, a catch for gdb_exception_forced_quit has been
added; this catch block will simply call quit_force(), which will
cause the necessary cleanups to occur followed by GDB exiting.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=26761
Tested-by: Tom de Vries <tdevries@suse.de>
Approved-By: Pedro Alves <pedro@palves.net>
#include "symtab.h"
#include "libguile.h"
#include "objfiles.h"
+#include "top.h" /* For quit_force(). */
struct block;
struct frame_info;
{
result = func (std::forward<Args> (args)...);
}
+ catch (const gdb_exception_forced_quit &e)
+ {
+ quit_force (NULL, 0);
+ }
catch (const gdb_exception &except)
{
exc = unpack (except);
conventions, et.al. */
#include "defs.h"
+#include "top.h" /* For quit_force(). */
#include "charset.h"
#include "symtab.h" /* Needed by language.h. */
#include "language.h"
(_("invalid result from pretty-printer to-string"), result);
}
}
+ catch (const gdb_exception_forced_quit &except)
+ {
+ quit_force (NULL, 0);
+ }
catch (const gdb_exception &except)
{
}
conventions, et.al. */
#include "defs.h"
+#include "top.h" /* For quit_force(). */
#include "arch-utils.h"
#include "value.h"
#include "gdbtypes.h"
&type_print_raw_options);
return stb.release ();
}
+ catch (const gdb_exception_forced_quit &except)
+ {
+ quit_force (NULL, 0);
+ }
catch (const gdb_exception &except)
{
excp = gdbscm_scm_from_gdb_exception (unpack (except));
conventions, et.al. */
#include "defs.h"
+#include "top.h" /* For quit_force(). */
#include "arch-utils.h"
#include "charset.h"
#include "cp-abi.h"
{
address = vlscm_scm_from_value (value_addr (value));
}
+ catch (const gdb_exception_forced_quit &except)
+ {
+ quit_force (NULL, 0);
+ }
catch (const gdb_exception &except)
{
}
extern void init_history (void);
extern void command_loop (void);
extern int quit_confirm (void);
-extern void quit_force (int *, int);
+extern void quit_force (int *, int) ATTRIBUTE_NORETURN;
extern void quit_command (const char *, int);
extern void quit_cover (void);
extern void execute_command (const char *, int);