From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH v2 3/3] Use bool for "warn_if_slow"
Date: Fri, 27 Feb 2026 07:28:15 -0700 [thread overview]
Message-ID: <20260227-target-fd-newtype-v2-3-7a266666ae36@adacore.com> (raw)
In-Reply-To: <20260227-target-fd-newtype-v2-0-7a266666ae36@adacore.com>
A few places still used int for the type of the 'warn_if_slow' flag.
This fixes all these spots.
---
gdb/inf-child.c | 2 +-
gdb/inf-child.h | 2 +-
gdb/linux-nat.c | 2 +-
gdb/linux-nat.h | 2 +-
gdb/remote.c | 8 ++++----
gdb/target.c | 2 +-
gdb/target.h | 2 +-
7 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index 22e52686d5e..7983ecb0d92 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -234,7 +234,7 @@ inf_child_target::pid_to_exec_file (int pid)
int
inf_child_target::fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *target_errno)
+ bool warn_if_slow, fileio_error *target_errno)
{
int nat_flags;
mode_t nat_mode;
diff --git a/gdb/inf-child.h b/gdb/inf-child.h
index 7d2d4eab68e..9fa62664b36 100644
--- a/gdb/inf-child.h
+++ b/gdb/inf-child.h
@@ -75,7 +75,7 @@ class inf_child_target
int fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *target_errno) override;
+ bool warn_if_slow, fileio_error *target_errno) override;
int fileio_pwrite (int fd, const gdb_byte *write_buf, int len,
ULONGEST offset, fileio_error *target_errno) override;
int fileio_pread (int fd, gdb_byte *read_buf, int len,
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 22dbfbc31f9..1d0a4609a3a 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -4573,7 +4573,7 @@ linux_nat_fileio_pid_of (struct inferior *inf)
int
linux_nat_target::fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *target_errno)
+ bool warn_if_slow, fileio_error *target_errno)
{
int nat_flags;
mode_t nat_mode;
diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
index 2d2ccbc2371..0f128892735 100644
--- a/gdb/linux-nat.h
+++ b/gdb/linux-nat.h
@@ -101,7 +101,7 @@ class linux_nat_target : public inf_ptrace_target
int fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *target_errno) override;
+ bool warn_if_slow, fileio_error *target_errno) override;
std::optional<std::string>
fileio_readlink (struct inferior *inf,
diff --git a/gdb/remote.c b/gdb/remote.c
index 04b24f0a703..7ec4cbf3209 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1115,7 +1115,7 @@ class remote_target : public process_stratum_target
int fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow,
+ bool warn_if_slow,
fileio_error *target_errno) override;
int fileio_pwrite (int fd, const gdb_byte *write_buf, int len,
@@ -1291,7 +1291,7 @@ class remote_target : public process_stratum_target
/* We should get rid of this and use fileio_open directly. */
int remote_hostio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *remote_errno);
+ bool warn_if_slow, fileio_error *remote_errno);
int remote_hostio_close (int fd, fileio_error *remote_errno);
int remote_hostio_unlink (inferior *inf, const char *filename,
@@ -13403,7 +13403,7 @@ int
remote_target::remote_hostio_open (inferior *inf, const char *filename,
fileio_open_flags flags,
fileio_mode_flags mode,
- int warn_if_slow,
+ bool warn_if_slow,
fileio_error *remote_errno)
{
struct remote_state *rs = get_remote_state ();
@@ -13450,7 +13450,7 @@ remote_target::remote_hostio_open (inferior *inf, const char *filename,
int
remote_target::fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *remote_errno)
+ bool warn_if_slow, fileio_error *remote_errno)
{
return remote_hostio_open (inf, filename, flags, mode, warn_if_slow,
remote_errno);
diff --git a/gdb/target.c b/gdb/target.c
index 611f37c9730..66672f3ca38 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3177,7 +3177,7 @@ fileio_fd_to_fh (target_fd fd)
int
target_ops::fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *target_errno)
+ bool warn_if_slow, fileio_error *target_errno)
{
*target_errno = FILEIO_ENOSYS;
return -1;
diff --git a/gdb/target.h b/gdb/target.h
index 89f6180b9e5..95434f8e342 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -992,7 +992,7 @@ struct target_ops
*TARGET_ERRNO). */
virtual int fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *target_errno);
+ bool warn_if_slow, fileio_error *target_errno);
/* Write up to LEN bytes from WRITE_BUF to FD on the target.
Return the number of bytes written, or -1 if an error occurs
--
2.53.0
prev parent reply other threads:[~2026-02-27 14:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 14:28 [PATCH v2 0/3] Stronger typing for remote file i/o Tom Tromey
2026-02-27 14:28 ` [PATCH v2 1/3] Use a newtype for remote file descriptor Tom Tromey
2026-02-27 16:30 ` Simon Marchi
2026-02-27 18:17 ` Tom Tromey
2026-02-27 18:22 ` Tom Tromey
2026-02-27 14:28 ` [PATCH v2 2/3] Use enum types for remote fileio flags Tom Tromey
2026-02-27 14:28 ` Tom Tromey [this message]
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=20260227-target-fd-newtype-v2-3-7a266666ae36@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