gdb: some int to bool conversion
authorAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 7 May 2021 15:49:24 +0000 (16:49 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 7 May 2021 16:00:25 +0000 (17:00 +0100)
Change int parameter to bool in remote_notice_new_inferior (remote.c)
and notice_new_inferior (infcmd.c), and update the callers.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* infcmd.c (notice_new_inferior): Change parameter type.
* inferior.h (notice_new_inferior): Change parameter type.
* remote.c (remote_notice_new_inferior): Change parameter type to
bool.  Also update type of local variable to bool.
(remote_target::update_thread_list): Change type of local variable
to bool.
(remote_target::process_stop_reply): Pass bool instead of int to
remote_notice_new_inferior.

gdb/ChangeLog
gdb/infcmd.c
gdb/inferior.h
gdb/remote.c

index e75eb04247b78c4c43d8130c030fdc0345b60717..9c7fdc3abcf1bbd10a0d82fff9302e9111882d4d 100644 (file)
@@ -1,3 +1,14 @@
+2021-05-07  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * infcmd.c (notice_new_inferior): Change parameter type.
+       * inferior.h (notice_new_inferior): Change parameter type.
+       * remote.c (remote_notice_new_inferior): Change parameter type to
+       bool.  Also update type of local variable to bool.
+       (remote_target::update_thread_list): Change type of local variable
+       to bool.
+       (remote_target::process_stop_reply): Pass bool instead of int to
+       remote_notice_new_inferior.
+
 2021-05-07  Simon Marchi  <simon.marchi@efficios.com>
 
        * target.c (target_stack::unpush): Call target_ops::find_beneath
index 5d9d79261efe622a3786579141233459be6ed110..f0b044d62b946e28403c781ac25419632e656bf6 100644 (file)
@@ -2675,7 +2675,7 @@ attach_command (const char *args, int from_tty)
    as stopped.  */
 
 void
-notice_new_inferior (thread_info *thr, int leave_running, int from_tty)
+notice_new_inferior (thread_info *thr, bool leave_running, int from_tty)
 {
   enum attach_post_wait_mode mode
     = leave_running ? ATTACH_POST_WAIT_RESUME : ATTACH_POST_WAIT_NOTHING;
index 4a143c3a2b8e8a9b2eafdf96f7231991ab07d77f..f4b8b025e35362d6c6aae9fcaff0b3243402d2f8 100644 (file)
@@ -218,7 +218,7 @@ using delete_longjmp_breakpoint_cleanup
 
 extern void detach_command (const char *, int);
 
-extern void notice_new_inferior (struct thread_info *, int, int);
+extern void notice_new_inferior (struct thread_info *, bool, int);
 
 extern struct value *get_return_value (struct value *function,
                                       struct type *value_type);
index a7312a9fc2d176e42d16fc672e22925ae336f8ac..d3a66599122c105a4ca9a8d2853a03255558de95 100644 (file)
@@ -764,7 +764,7 @@ public: /* Remote specific methods.  */
   ptid_t select_thread_for_ambiguous_stop_reply
     (const struct target_waitstatus *status);
 
-  void remote_notice_new_inferior (ptid_t currthread, int executing);
+  void remote_notice_new_inferior (ptid_t currthread, bool executing);
 
   void process_initial_stop_replies (int from_tty);
 
@@ -2556,12 +2556,12 @@ remote_target::remote_add_thread (ptid_t ptid, bool running, bool executing)
    thread is (internally) executing or stopped.  */
 
 void
-remote_target::remote_notice_new_inferior (ptid_t currthread, int executing)
+remote_target::remote_notice_new_inferior (ptid_t currthread, bool executing)
 {
   /* In non-stop mode, we assume new found threads are (externally)
      running until proven otherwise with a stop reply.  In all-stop,
      we can only get here if all threads are stopped.  */
-  int running = target_is_non_stop_p () ? 1 : 0;
+  bool running = target_is_non_stop_p ();
 
   /* If this is a new thread, add it to GDB's thread list.
      If we leave it up to WFI to do this, bad things will happen.  */
@@ -3955,7 +3955,7 @@ remote_target::update_thread_list ()
                 executing until proven otherwise with a stop reply.
                 In all-stop, we can only get here if all threads are
                 stopped.  */
-             int executing = target_is_non_stop_p () ? 1 : 0;
+             bool executing = target_is_non_stop_p ();
 
              remote_notice_new_inferior (item.ptid, executing);
 
@@ -8036,7 +8036,7 @@ remote_target::process_stop_reply (struct stop_reply *stop_reply,
          stop_reply->regcache.clear ();
        }
 
-      remote_notice_new_inferior (ptid, 0);
+      remote_notice_new_inferior (ptid, false);
       remote_thread_info *remote_thr = get_remote_thread_info (this, ptid);
       remote_thr->core = stop_reply->core;
       remote_thr->stop_reason = stop_reply->stop_reason;
This page took 0.035831 seconds and 4 git commands to generate.