gdbserver: turn target ops 'pause_all' and 'unpause_all' into methods
[deliverable/binutils-gdb.git] / gdbserver / server.cc
index f427e7706fbb62730636902bd77aaa2fcafab6db..670c0fed968c1f56296d8d09ccf391f950792990 100644 (file)
@@ -1792,13 +1792,13 @@ static int
 handle_qxfer_fdpic (const char *annex, gdb_byte *readbuf,
                    const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 {
-  if (the_target->read_loadmap == NULL)
+  if (!the_target->pt->supports_read_loadmap ())
     return -2;
 
   if (current_thread == NULL)
     return -1;
 
-  return (*the_target->read_loadmap) (annex, offset, readbuf, len);
+  return the_target->pt->read_loadmap (annex, offset, readbuf, len);
 }
 
 /* Handle qXfer:btrace:read.  */
@@ -2380,7 +2380,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
       if (the_target->pt->supports_qxfer_siginfo ())
        strcat (own_buf, ";qXfer:siginfo:read+;qXfer:siginfo:write+");
 
-      if (the_target->read_loadmap != NULL)
+      if (the_target->pt->supports_read_loadmap ())
        strcat (own_buf, ";qXfer:fdpic:read+");
 
       /* We always report qXfer:features:read, as targets may
@@ -2532,7 +2532,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
     }
 
   /* Windows OS Thread Information Block address support.  */
-  if (the_target->get_tib_address != NULL
+  if (the_target->pt->supports_get_tib_address ()
       && startswith (own_buf, "qGetTIBAddr:"))
     {
       const char *annex;
@@ -2540,7 +2540,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
       CORE_ADDR tlb;
       ptid_t ptid = read_ptid (own_buf + 12, &annex);
 
-      n = (*the_target->get_tib_address) (ptid, &tlb);
+      n = the_target->pt->get_tib_address (ptid, &tlb);
       if (n == 1)
        {
          strcpy (own_buf, paddress(tlb));
@@ -2577,8 +2577,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
 
       write_ok (own_buf);
 
-      if (the_target->handle_monitor_command == NULL
-         || (*the_target->handle_monitor_command) (mon) == 0)
+      if (the_target->pt->handle_monitor_command (mon) == 0)
        /* Default processing.  */
        handle_monitor_command (mon, own_buf);
 
@@ -3218,7 +3217,7 @@ queue_stop_reply_callback (thread_info *thread)
 {
   /* For now, assume targets that don't have this callback also don't
      manage the thread's last_status field.  */
-  if (the_target->thread_stopped == NULL)
+  if (!the_target->pt->supports_thread_stopped ())
     {
       struct vstop_notif *new_notif = new struct vstop_notif;
 
@@ -3230,7 +3229,7 @@ queue_stop_reply_callback (thread_info *thread)
     }
   else
     {
-      if (thread_stopped (thread))
+      if (target_thread_stopped (thread))
        {
          if (debug_threads)
            {
@@ -3324,7 +3323,7 @@ handle_status (char *own_buf)
     {
       thread_info *thread = NULL;
 
-      pause_all (0);
+      target_pause_all (false);
       stabilize_threads ();
       gdb_wants_all_threads_stopped ();
 
This page took 0.02429 seconds and 4 git commands to generate.