Rename functions and make nonstatic as necessary
[deliverable/binutils-gdb.git] / gdb / i386-nat.c
index 4282535b445dc4d921db839fe5df44ee25dc8447..86e655fa837febb44ef28a1098532e2a525479b5 100644 (file)
@@ -103,7 +103,7 @@ struct i386_dr_low_type i386_dr_low;
 
    Currently, all watchpoint are locally enabled.  If you need to
    enable them globally, read the comment which pertains to this in
-   i386_insert_aligned_watchpoint below.  */
+   i386_dr_insert_aligned_watchpoint below.  */
 #define DR_LOCAL_ENABLE_SHIFT  0 /* Extra shift to the local enable bit.  */
 #define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit.  */
 #define DR_ENABLE_SIZE         2 /* Two enable bits per debug register.  */
@@ -289,8 +289,8 @@ i386_cleanup_dregs (void)
 
 /* Print the values of the mirrored debug registers.  */
 
-static void
-i386_show_dr (struct i386_debug_reg_state *state,
+void
+i386_dr_show (struct i386_debug_reg_state *state,
              const char *func, CORE_ADDR addr,
              int len, enum target_hw_bp_type type)
 {
@@ -330,8 +330,8 @@ i386_show_dr (struct i386_debug_reg_state *state,
    region of LEN bytes for accesses of type TYPE.  LEN is assumed to
    have the value of 1, 2, or 4.  */
 
-static unsigned
-i386_length_and_rw_bits (int len, enum target_hw_bp_type type)
+unsigned
+i386_dr_length_and_rw_bits (int len, enum target_hw_bp_type type)
 {
   unsigned rw;
 
@@ -358,7 +358,7 @@ i386_length_and_rw_bits (int len, enum target_hw_bp_type type)
 #endif
       default:
        internal_error (__FILE__, __LINE__, _("\
-Invalid hardware breakpoint type %d in i386_length_and_rw_bits.\n"),
+Invalid hardware breakpoint type %d in i386_dr_length_and_rw_bits.\n"),
                        (int) type);
     }
 
@@ -376,7 +376,7 @@ Invalid hardware breakpoint type %d in i386_length_and_rw_bits.\n"),
        /* ELSE FALL THROUGH */
       default:
        internal_error (__FILE__, __LINE__, _("\
-Invalid hardware breakpoint length %d in i386_length_and_rw_bits.\n"), len);
+Invalid hardware breakpoint length %d in i386_dr_length_and_rw_bits.\n"), len);
     }
 }
 
@@ -386,9 +386,9 @@ Invalid hardware breakpoint length %d in i386_length_and_rw_bits.\n"), len);
    type of the region to be watched by this watchpoint.  Return 0 on
    success, -1 on failure.  */
 
-static int
-i386_insert_aligned_watchpoint (struct i386_debug_reg_state *state,
-                               CORE_ADDR addr, unsigned len_rw_bits)
+int
+i386_dr_insert_aligned_watchpoint (struct i386_debug_reg_state *state,
+                                  CORE_ADDR addr, unsigned len_rw_bits)
 {
   int i;
 
@@ -446,9 +446,9 @@ i386_insert_aligned_watchpoint (struct i386_debug_reg_state *state,
    type of the region watched by this watchpoint.  Return 0 on
    success, -1 on failure.  */
 
-static int
-i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state,
-                               CORE_ADDR addr, unsigned len_rw_bits)
+int
+i386_dr_remove_aligned_watchpoint (struct i386_debug_reg_state *state,
+                                  CORE_ADDR addr, unsigned len_rw_bits)
 {
   int i, retval = -1;
 
@@ -518,12 +518,12 @@ i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state,
        }
       else
        {
-         unsigned len_rw = i386_length_and_rw_bits (size, type);
+         unsigned len_rw = i386_dr_length_and_rw_bits (size, type);
 
          if (what == WP_INSERT)
-           retval = i386_insert_aligned_watchpoint (state, addr, len_rw);
+           retval = i386_dr_insert_aligned_watchpoint (state, addr, len_rw);
          else if (what == WP_REMOVE)
-           retval = i386_remove_aligned_watchpoint (state, addr, len_rw);
+           retval = i386_dr_remove_aligned_watchpoint (state, addr, len_rw);
          else
            internal_error (__FILE__, __LINE__, _("\
 Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n"),
@@ -542,9 +542,9 @@ Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n"),
 /* Update the inferior debug registers state, in STATE, with the
    new debug registers state, in NEW_STATE.  */
 
-static void
-i386_update_inferior_debug_regs (struct i386_debug_reg_state *state,
-                                struct i386_debug_reg_state *new_state)
+void
+i386_dr_update_inferior_debug_regs (struct i386_debug_reg_state *state,
+                                   struct i386_debug_reg_state *new_state)
 {
   int i;
 
@@ -591,17 +591,17 @@ i386_insert_watchpoint (struct target_ops *self,
     }
   else
     {
-      unsigned len_rw = i386_length_and_rw_bits (len, type);
+      unsigned len_rw = i386_dr_length_and_rw_bits (len, type);
 
-      retval = i386_insert_aligned_watchpoint (&local_state,
+      retval = i386_dr_insert_aligned_watchpoint (&local_state,
                                               addr, len_rw);
     }
 
   if (retval == 0)
-    i386_update_inferior_debug_regs (state, &local_state);
+    i386_dr_update_inferior_debug_regs (state, &local_state);
 
   if (debug_hw_points)
-    i386_show_dr (state, "insert_watchpoint", addr, len, type);
+    i386_dr_show (state, "insert_watchpoint", addr, len, type);
 
   return retval;
 }
@@ -631,17 +631,17 @@ i386_remove_watchpoint (struct target_ops *self,
     }
   else
     {
-      unsigned len_rw = i386_length_and_rw_bits (len, type);
+      unsigned len_rw = i386_dr_length_and_rw_bits (len, type);
 
-      retval = i386_remove_aligned_watchpoint (&local_state,
+      retval = i386_dr_remove_aligned_watchpoint (&local_state,
                                               addr, len_rw);
     }
 
   if (retval == 0)
-    i386_update_inferior_debug_regs (state, &local_state);
+    i386_dr_update_inferior_debug_regs (state, &local_state);
 
   if (debug_hw_points)
-    i386_show_dr (state, "remove_watchpoint", addr, len, type);
+    i386_dr_show (state, "remove_watchpoint", addr, len, type);
 
   return retval;
 }
@@ -734,12 +734,12 @@ i386_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
          addr = i386_dr_low_get_addr (i);
          rc = 1;
          if (debug_hw_points)
-           i386_show_dr (state, "watchpoint_hit", addr, -1, hw_write);
+           i386_dr_show (state, "watchpoint_hit", addr, -1, hw_write);
        }
     }
 
   if (debug_hw_points && addr == 0)
-    i386_show_dr (state, "stopped_data_addr", 0, 0, hw_write);
+    i386_dr_show (state, "stopped_data_addr", 0, 0, hw_write);
 
   if (rc)
     *addr_p = addr;
@@ -764,19 +764,20 @@ i386_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch,
 {
   struct i386_debug_reg_state *state
     = i386_debug_reg_state (ptid_get_pid (inferior_ptid));
-  unsigned len_rw = i386_length_and_rw_bits (1, hw_execute);
+  unsigned len_rw = i386_dr_length_and_rw_bits (1, hw_execute);
   CORE_ADDR addr = bp_tgt->placed_address;
   /* Work on a local copy of the debug registers, and on success,
      commit the change back to the inferior.  */
   struct i386_debug_reg_state local_state = *state;
-  int retval = i386_insert_aligned_watchpoint (&local_state,
-                                              addr, len_rw) ? EBUSY : 0;
+  int retval = i386_dr_insert_aligned_watchpoint (&local_state,
+                                                 addr,
+                                                 len_rw) ? EBUSY : 0;
 
   if (retval == 0)
-    i386_update_inferior_debug_regs (state, &local_state);
+    i386_dr_update_inferior_debug_regs (state, &local_state);
 
   if (debug_hw_points)
-    i386_show_dr (state, "insert_hwbp", addr, 1, hw_execute);
+    i386_dr_show (state, "insert_hwbp", addr, 1, hw_execute);
 
   return retval;
 }
@@ -790,19 +791,19 @@ i386_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch,
 {
   struct i386_debug_reg_state *state
     = i386_debug_reg_state (ptid_get_pid (inferior_ptid));
-  unsigned len_rw = i386_length_and_rw_bits (1, hw_execute);
+  unsigned len_rw = i386_dr_length_and_rw_bits (1, hw_execute);
   CORE_ADDR addr = bp_tgt->placed_address;
   /* Work on a local copy of the debug registers, and on success,
      commit the change back to the inferior.  */
   struct i386_debug_reg_state local_state = *state;
-  int retval = i386_remove_aligned_watchpoint (&local_state,
-                                              addr, len_rw);
+  int retval = i386_dr_remove_aligned_watchpoint (&local_state,
+                                                 addr, len_rw);
 
   if (retval == 0)
-    i386_update_inferior_debug_regs (state, &local_state);
+    i386_dr_update_inferior_debug_regs (state, &local_state);
 
   if (debug_hw_points)
-    i386_show_dr (state, "remove_hwbp", addr, 1, hw_execute);
+    i386_dr_show (state, "remove_hwbp", addr, 1, hw_execute);
 
   return retval;
 }
This page took 0.028353 seconds and 4 git commands to generate.