Use bool, true, and false in arc-tdep.c
[deliverable/binutils-gdb.git] / gdb / remote.c
index 0424ea4ef1ee7b38e3ff677779dc007131bd1280..5e5fbbf8c34d09fe2de06eb6ff7b348a6d0aaf7b 100644 (file)
@@ -485,6 +485,9 @@ public:
                                             int handle_len,
                                             inferior *inf) override;
 
+  gdb::byte_vector thread_info_to_thread_handle (struct thread_info *tp)
+                                                override;
+
   void stop (ptid_t) override;
 
   void interrupt () override;
@@ -764,7 +767,7 @@ public: /* Remote specific methods.  */
 
   char *remote_get_noisy_reply ();
   int remote_query_attached (int pid);
-  inferior *remote_add_inferior (int fake_pid_p, int pid, int attached,
+  inferior *remote_add_inferior (bool fake_pid_p, int pid, int attached,
                                 int try_open_exec);
 
   ptid_t remote_current_thread (ptid_t oldpid);
@@ -1151,7 +1154,7 @@ remote_target::remote_get_noisy_reply ()
              gdbarch_relocate_instruction (target_gdbarch (), &to, from);
              relocated = 1;
            }
-         catch (const gdb_exception_RETURN_MASK_ALL &ex)
+         catch (const gdb_exception &ex)
            {
              if (ex.error == MEMORY_ERROR)
                {
@@ -2351,7 +2354,7 @@ remote_target::remote_query_attached (int pid)
    if no main executable is open already.  */
 
 inferior *
-remote_target::remote_add_inferior (int fake_pid_p, int pid, int attached,
+remote_target::remote_add_inferior (bool fake_pid_p, int pid, int attached,
                                    int try_open_exec)
 {
   struct inferior *inf;
@@ -2492,7 +2495,7 @@ remote_target::remote_notice_new_inferior (ptid_t currthread, int executing)
       if (find_inferior_pid (currthread.pid ()) == NULL)
        {
          struct remote_state *rs = get_remote_state ();
-         int fake_pid_p = !remote_multi_process_p (rs);
+         bool fake_pid_p = !remote_multi_process_p (rs);
 
          inf = remote_add_inferior (fake_pid_p,
                                     currthread.pid (), -1, 1);
@@ -4049,7 +4052,7 @@ remote_target::~remote_target ()
   if (rs->remote_async_inferior_event_token)
     delete_async_event_handler (&rs->remote_async_inferior_event_token);
 
-  remote_notif_state_xfree (rs->notif_state);
+  delete rs->notif_state;
 }
 
 /* Query the remote side for the text, data and bss offsets.  */
@@ -4308,7 +4311,7 @@ void
 remote_target::add_current_inferior_and_thread (char *wait_status)
 {
   struct remote_state *rs = get_remote_state ();
-  int fake_pid_p = 0;
+  bool fake_pid_p = false;
 
   inferior_ptid = null_ptid;
 
@@ -4318,7 +4321,7 @@ remote_target::add_current_inferior_and_thread (char *wait_status)
   if (curr_ptid != null_ptid)
     {
       if (!remote_multi_process_p (rs))
-       fake_pid_p = 1;
+       fake_pid_p = true;
     }
   else
     {
@@ -4327,7 +4330,7 @@ remote_target::add_current_inferior_and_thread (char *wait_status)
         double duty as both the pid of the target process (if it has
         such), and as a flag indicating that a target is active.  */
       curr_ptid = magic_null_ptid;
-      fake_pid_p = 1;
+      fake_pid_p = true;
     }
 
   remote_add_inferior (fake_pid_p, curr_ptid.pid (), -1, 1);
@@ -5605,13 +5608,13 @@ remote_target::open_1 (const char *name, int from_tty, int extended_p)
       {
        remote->start_remote (from_tty, extended_p);
       }
-    catch (const gdb_exception_RETURN_MASK_ALL &ex)
+    catch (const gdb_exception &ex)
       {
        /* Pop the partially set up target - unless something else did
           already before throwing the exception.  */
        if (ex.error != TARGET_CLOSE_ERROR)
          remote_unpush_target ();
-       throw_exception (ex);
+       throw;
       }
   }
 
@@ -5844,7 +5847,7 @@ extended_remote_target::attach (const char *args, int from_tty)
             target_pid_to_str (ptid_t (pid)).c_str ());
     }
 
-  set_current_inferior (remote_add_inferior (0, pid, 1, 0));
+  set_current_inferior (remote_add_inferior (false, pid, 1, 0));
 
   inferior_ptid = ptid_t (pid);
 
@@ -9768,7 +9771,7 @@ remote_target::remote_kill_k ()
     {
       putpkt ("k");
     }
-  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const gdb_exception_error &ex)
     {
       if (ex.error == TARGET_CLOSE_ERROR)
        {
@@ -9784,7 +9787,7 @@ remote_target::remote_kill_k ()
       /* Otherwise, something went wrong.  We didn't actually kill
         the target.  Just propagate the exception, and let the
         user or higher layers decide what to do.  */
-      throw_exception (ex);
+      throw;
     }
 }
 
@@ -13136,14 +13139,14 @@ remote_target::get_trace_status (struct trace_status *ts)
     {
       p = remote_get_noisy_reply ();
     }
-  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const gdb_exception_error &ex)
     {
       if (ex.error != TARGET_CLOSE_ERROR)
        {
          exception_fprintf (gdb_stderr, ex, "qTStatus: ");
          return -1;
        }
-      throw_exception (ex);
+      throw;
     }
 
   result = packet_ok (p, &remote_protocol_packets[PACKET_qTStatus]);
@@ -13790,7 +13793,7 @@ remote_target::enable_btrace (ptid_t ptid, const struct btrace_config *conf)
     {
       btrace_read_config (&tinfo->conf);
     }
-  catch (const gdb_exception_RETURN_MASK_ERROR &err)
+  catch (const gdb_exception_error &err)
     {
       if (err.message != NULL)
        warning ("%s", err.what ());
@@ -13998,6 +14001,13 @@ remote_target::thread_handle_to_thread_info (const gdb_byte *thread_handle,
   return NULL;
 }
 
+gdb::byte_vector
+remote_target::thread_info_to_thread_handle (struct thread_info *tp)
+{
+  remote_thread_info *priv = get_remote_thread_info (tp);
+  return priv->thread_handle;
+}
+
 bool
 remote_target::can_async_p ()
 {
This page took 0.026977 seconds and 4 git commands to generate.