From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH] Minor boolification with interrupt_target_1
Date: Thu, 12 Nov 2026 11:58:50 -0700 [thread overview]
Message-ID: <20261112185850.2852421-1-tromey@adacore.com> (raw)
This patch changes the callers of interrupt_target_1 to use bool
rather than relying on int to bool conversions.
---
gdb/infcmd.c | 4 ++--
gdb/mi/mi-main.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index a9bceba1087..53a100b314c 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -3176,13 +3176,13 @@ interrupt_command (const char *args, int from_tty)
{
if (target_can_async_p ())
{
- int all_threads = 0;
+ bool all_threads = false;
dont_repeat (); /* Not for the faint of heart. */
if (args != nullptr
&& startswith (args, "-a"))
- all_threads = 1;
+ all_threads = true;
interrupt_target_1 (all_threads);
}
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 42f5dcc3ded..38d61c53102 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -330,14 +330,14 @@ mi_cmd_exec_interrupt (const char *command, const char *const *argv, int argc)
anything specific. */
if (!non_stop)
{
- interrupt_target_1 (0);
+ interrupt_target_1 (false);
return;
}
if (current_context->all)
{
/* This will interrupt all threads in all inferiors. */
- interrupt_target_1 (1);
+ interrupt_target_1 (true);
}
else if (current_context->thread_group != -1)
{
@@ -359,7 +359,7 @@ mi_cmd_exec_interrupt (const char *command, const char *const *argv, int argc)
/* Interrupt just the current thread -- either explicitly
specified via --thread or whatever was current before
MI command was sent. */
- interrupt_target_1 (0);
+ interrupt_target_1 (false);
}
}
base-commit: c79376a262328164cdf81eddfcc5518314b1856a
--
2.56.0
next reply other threads:[~2026-11-12 18:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 18:58 Tom Tromey [this message]
2026-11-13 15:37 ` Tom de Vries
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261112185850.2852421-1-tromey@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox