This is called by GDB's SIGINT handler and must be async-safe. */
void (*set_quit_flag) (const struct extension_language_defn *);
- /* Return non-zero if a SIGINT has occurred.
+ /* Return true if a SIGINT has occurred.
This is expected to also clear the indicator. */
- int (*check_quit_flag) (const struct extension_language_defn *);
+ bool (*check_quit_flag) (const struct extension_language_defn *);
/* Called before gdb prints its prompt, giving extension languages an
opportunity to change it with set_prompt.
/* See extension.h. */
-int
+bool
check_quit_flag ()
{
#if CXX_STD_THREAD
std::lock_guard guard (ext_lang_mutex);
#endif /* CXX_STD_THREAD */
- int result = 0;
+ bool result = false;
for (const struct extension_language_defn *extlang : extension_languages)
{
if (extlang->ops != nullptr
&& extlang->ops->check_quit_flag != NULL)
- if (extlang->ops->check_quit_flag (extlang) != 0)
- result = 1;
+ if (extlang->ops->check_quit_flag (extlang))
+ result = true;
}
/* This is written in a particular way to avoid races. */
request. */
quit_serial_event_clear ();
quit_flag = 0;
- result = 1;
+ result = true;
}
return result;
The flag is checked in all extension languages that support cooperative
SIGINT handling, not just the current one. This simplifies transitions. */
-extern int check_quit_flag ();
+extern bool check_quit_flag ();
/* Set the quit flag.
This only sets the flag in the currently active extension language.
static void gdbpy_free_type_printers (const struct extension_language_defn *,
struct ext_lang_type_printers *);
static void gdbpy_set_quit_flag (const struct extension_language_defn *);
-static int gdbpy_check_quit_flag (const struct extension_language_defn *);
+static bool gdbpy_check_quit_flag (const struct extension_language_defn *);
static enum ext_lang_rc gdbpy_before_prompt_hook
(const struct extension_language_defn *, const char *current_gdb_prompt);
static std::optional<std::string> gdbpy_colorize
/* Return true if the quit flag has been set, false otherwise. */
-static int
+static bool
gdbpy_check_quit_flag (const struct extension_language_defn *extlang)
{
if (!gdb_python_initialized)
- return 0;
+ return false;
gdbpy_gil gil;
return PyOS_InterruptOccurred ();
remote_fileio_reply (remote_target *remote, int retcode, int error)
{
char buf[32];
- int ctrl_c = check_quit_flag ();
+ bool ctrl_c = check_quit_flag ();
strcpy (buf, "F");
if (retcode < 0)