]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdbserver/nto-low.cc
gdbserver: turn target op 'supports_z_point_type' into a method
[thirdparty/binutils-gdb.git] / gdbserver / nto-low.cc
index a051f36eeccf78a3c261e42b7e0f83e2f39adbcc..204d8066455e540f9bfec870529654af64b943c3 100644 (file)
@@ -706,8 +706,9 @@ nto_process_target::store_registers (regcache *regcache, int regno)
 
    Return 0 on success -1 otherwise.  */
 
-static int
-nto_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
+int
+nto_process_target::read_memory (CORE_ADDR memaddr, unsigned char *myaddr,
+                                int len)
 {
   TRACE ("%s memaddr:0x%08lx, len:%d\n", __func__, memaddr, len);
 
@@ -725,8 +726,9 @@ nto_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
 
    Return 0 on success -1 otherwise.  */
 
-static int
-nto_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len)
+int
+nto_process_target::write_memory (CORE_ADDR memaddr,
+                                 const unsigned char *myaddr, int len)
 {
   int len_written;
 
@@ -744,8 +746,8 @@ nto_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len)
 
 /* Stop inferior.  We always stop all threads.  */
 
-static void
-nto_request_interrupt (void)
+void
+nto_process_target::request_interrupt ()
 {
   TRACE ("%s\n", __func__);
   nto_set_thread (ptid_t (nto_inferior.pid, 1, 0));
@@ -753,14 +755,21 @@ nto_request_interrupt (void)
     TRACE ("Error stopping inferior.\n");
 }
 
+bool
+nto_process_target::supports_read_auxv ()
+{
+  return true;
+}
+
 /* Read auxiliary vector from inferior's memory into gdbserver's buffer
    MYADDR.  We always read whole auxv.  
    
    Return number of bytes stored in MYADDR buffer, 0 if OFFSET > 0
    or -1 on error.  */
 
-static int
-nto_read_auxv (CORE_ADDR offset, unsigned char *myaddr, unsigned int len)
+int
+nto_process_target::read_auxv (CORE_ADDR offset, unsigned char *myaddr,
+                              unsigned int len)
 {
   int err;
   CORE_ADDR initial_stack;
@@ -780,8 +789,8 @@ nto_read_auxv (CORE_ADDR offset, unsigned char *myaddr, unsigned int len)
   return nto_read_auxv_from_initial_stack (initial_stack, myaddr, len);
 }
 
-static int
-nto_supports_z_point_type (char z_type)
+bool
+nto_process_target::supports_z_point_type (char z_type)
 {
   switch (z_type)
     {
@@ -790,9 +799,9 @@ nto_supports_z_point_type (char z_type)
     case Z_PACKET_WRITE_WP:
     case Z_PACKET_READ_WP:
     case Z_PACKET_ACCESS_WP:
-      return 1;
+      return true;
     default:
-      return 0;
+      return false;
     }
 }
 
@@ -941,14 +950,6 @@ nto_sw_breakpoint_from_kind (int kind, int *size)
 static nto_process_target the_nto_target;
 
 static process_stratum_target nto_target_ops = {
-  NULL, /* prepare_to_access_memory */
-  NULL, /* done_accessing_memory */
-  nto_read_memory,
-  nto_write_memory,
-  NULL, /* nto_look_up_symbols */
-  nto_request_interrupt,
-  nto_read_auxv,
-  nto_supports_z_point_type,
   nto_insert_point,
   nto_remove_point,
   NULL, /* stopped_by_sw_breakpoint */