gdbserver: turn target ops 'insert_point' and 'remove_point' into methods
[deliverable/binutils-gdb.git] / gdbserver / nto-low.cc
index c229e41d5251341d9c0415ecc1efaa9cd43f529d..56d3462666767dfe61beafc1d8de3e3a5ba26904 100644 (file)
@@ -746,8 +746,8 @@ nto_process_target::write_memory (CORE_ADDR memaddr,
 
 /* 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));
@@ -755,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;
@@ -782,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)
     {
@@ -792,17 +799,17 @@ 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;
     }
 }
 
 /* Insert {break/watch}point at address ADDR.  SIZE is not used.  */
 
-static int
-nto_insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
-                 int size, struct raw_breakpoint *bp)
+int
+nto_process_target::insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
+                                 int size, raw_breakpoint *bp)
 {
   int wtype = _DEBUG_BREAK_HW; /* Always request HW.  */
 
@@ -832,9 +839,9 @@ nto_insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
 
 /* Remove {break/watch}point at address ADDR.  SIZE is not used.  */
 
-static int
-nto_remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
-                 int size, struct raw_breakpoint *bp)
+int
+nto_process_target::remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
+                                 int size, raw_breakpoint *bp)
 {
   int wtype = _DEBUG_BREAK_HW; /* Always request HW.  */
 
@@ -943,11 +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 = {
-  nto_request_interrupt,
-  nto_read_auxv,
-  nto_supports_z_point_type,
-  nto_insert_point,
-  nto_remove_point,
   NULL, /* stopped_by_sw_breakpoint */
   NULL, /* supports_stopped_by_sw_breakpoint */
   NULL, /* stopped_by_hw_breakpoint */
This page took 0.034757 seconds and 4 git commands to generate.