]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use bool in thread_events
authorTom Tromey <tom@tromey.com>
Mon, 27 May 2024 20:12:33 +0000 (14:12 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 28 May 2024 15:54:48 +0000 (09:54 -0600)
This changes target_ops::thread_events and target_thread_events to use
'bool'.  The callers were already doing this.

Tested by rebuilding.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/amd-dbgapi-target.c
gdb/linux-nat.c
gdb/linux-nat.h
gdb/remote.c
gdb/target-delegates.c
gdb/target.c
gdb/target.h

index fcde6d27ffb38bfad81233809397ec8a29e39a57..073270f0c2171eb50a6306ef59ee8112bff665ea 100644 (file)
@@ -269,7 +269,7 @@ struct amd_dbgapi_target final : public target_ops
 
   struct gdbarch *thread_architecture (ptid_t) override;
 
-  void thread_events (int enable) override;
+  void thread_events (bool enable) override;
 
   std::string pid_to_str (ptid_t ptid) override;
 
@@ -1805,7 +1805,7 @@ amd_dbgapi_target::thread_architecture (ptid_t ptid)
 }
 
 void
-amd_dbgapi_target::thread_events (int enable)
+amd_dbgapi_target::thread_events (bool enable)
 {
   m_report_thread_events = enable;
   beneath ()->thread_events (enable);
index 48ecd3627ca59236f324fd17fd7e0112ee66121d..c95d420d416e4c0cdbb130a9a659faf641608d14 100644 (file)
@@ -279,7 +279,7 @@ struct simple_pid_list
 static struct simple_pid_list *stopped_pids;
 
 /* Whether target_thread_events is in effect.  */
-static int report_thread_events;
+static bool report_thread_events;
 
 static int kill_lwp (int lwpid, int signo);
 
@@ -4618,7 +4618,7 @@ linux_nat_target::fileio_unlink (struct inferior *inf, const char *filename,
 /* Implementation of the to_thread_events method.  */
 
 void
-linux_nat_target::thread_events (int enable)
+linux_nat_target::thread_events (bool enable)
 {
   report_thread_events = enable;
 }
index 4dcbe9e170aba632ee487fb4aecf34b81bb6472f..92b16f7414e00f99041fa95c410ca5dbb527a13b 100644 (file)
@@ -78,7 +78,7 @@ public:
   bool stopped_by_hw_breakpoint () override;
   bool supports_stopped_by_hw_breakpoint () override;
 
-  void thread_events (int) override;
+  void thread_events (bool) override;
 
   bool supports_set_thread_options (gdb_thread_options options) override;
 
index 42b446c7e27e62d3021d279237a0a43119e0e8b5..965427c96a0d496b560de13f4a682fae0a508e2f 100644 (file)
@@ -965,7 +965,7 @@ public:
 
   int async_wait_fd () override;
 
-  void thread_events (int) override;
+  void thread_events (bool) override;
 
   bool supports_set_thread_options (gdb_thread_options) override;
 
@@ -15191,7 +15191,7 @@ remote_target::async (bool enable)
 /* Implementation of the to_thread_events method.  */
 
 void
-remote_target::thread_events (int enable)
+remote_target::thread_events (bool enable)
 {
   struct remote_state *rs = get_remote_state ();
   size_t size = get_remote_packet_size ();
index 5fb1c80a9c3aea70c9fc8c1cf4b038ac27ce218a..dd20e1404c32f45c536756e6e09cdadfab29d79b 100644 (file)
@@ -105,7 +105,7 @@ struct dummy_target : public target_ops
   void async (bool arg0) override;
   int async_wait_fd () override;
   bool has_pending_events () override;
-  void thread_events (int arg0) override;
+  void thread_events (bool arg0) override;
   bool supports_set_thread_options (gdb_thread_options arg0) override;
   bool supports_non_stop () override;
   bool always_non_stop_p () override;
@@ -282,7 +282,7 @@ struct debug_target : public target_ops
   void async (bool arg0) override;
   int async_wait_fd () override;
   bool has_pending_events () override;
-  void thread_events (int arg0) override;
+  void thread_events (bool arg0) override;
   bool supports_set_thread_options (gdb_thread_options arg0) override;
   bool supports_non_stop () override;
   bool always_non_stop_p () override;
@@ -2165,24 +2165,24 @@ debug_target::has_pending_events ()
 }
 
 void
-target_ops::thread_events (int arg0)
+target_ops::thread_events (bool arg0)
 {
   this->beneath ()->thread_events (arg0);
 }
 
 void
-dummy_target::thread_events (int arg0)
+dummy_target::thread_events (bool arg0)
 {
 }
 
 void
-debug_target::thread_events (int arg0)
+debug_target::thread_events (bool arg0)
 {
   target_debug_printf_nofunc ("-> %s->thread_events (...)", this->beneath ()->shortname ());
   this->beneath ()->thread_events (arg0);
   target_debug_printf_nofunc ("<- %s->thread_events (%s)",
              this->beneath ()->shortname (),
-             target_debug_print_int (arg0).c_str ());
+             target_debug_print_bool (arg0).c_str ());
 }
 
 bool
index a5c92a8a5119bff869217867ab11a9dbf63fc139..ddf10c28e1c7de310942232e9647f3b1006cbc43 100644 (file)
@@ -4286,7 +4286,7 @@ target_async (bool enable)
 /* See target.h.  */
 
 void
-target_thread_events (int enable)
+target_thread_events (bool enable)
 {
   current_inferior ()->top_target ()->thread_events (enable);
 }
index 394e377d0341b39e9f5ff00e87344096c0e777cd..81de4a678c3f0e0216e7ec27db8b4a70acf001bc 100644 (file)
@@ -755,7 +755,7 @@ struct target_ops
        potential optimization is missed.  */
     virtual bool has_pending_events ()
       TARGET_DEFAULT_RETURN (false);
-    virtual void thread_events (int)
+    virtual void thread_events (bool)
       TARGET_DEFAULT_IGNORE ();
     /* Returns true if the target supports setting thread options
        OPTIONS, false otherwise.  */
@@ -1920,7 +1920,7 @@ extern bool target_is_async_p ();
 extern void target_async (bool enable);
 
 /* Enables/disables thread create and exit events.  */
-extern void target_thread_events (int enable);
+extern void target_thread_events (bool enable);
 
 /* Returns true if the target supports setting thread options
    OPTIONS.  */