Partially revert 4be83cc2b28ea09aa8ff789839e6520df60836f8

The above commit did two things:

 1) A number of functions were renamed and made nonstatic.
 2) A number of other functions were renamed only.

This commit reverts #1 but not #2.  In addition, prototypes for
functions now remade static have been removed from i386-dregs.h.

gdb/
2014-06-19  Gary Benson  <gbenson@redhat.com>

	* i386-nat.c (i386_dr_show): Renamed to
	i386_show_dr and made static.  All uses updated.
	(i386_dr_length_and_rw_bits): Renamed to
	i386_length_and_rw_bits and made static.
	All uses updated.
	(i386_dr_insert_aligned_watchpoint): Renamed to
	i386_insert_aligned_watchpoint and made static.
	All uses updated.
	(i386_dr_remove_aligned_watchpoint): Renamed to
	i386_remove_aligned_watchpoint and made static.
	All uses updated.
	(i386_dr_update_inferior_debug_regs): Renamed to
	i386_update_inferior_debug_regs and made static.
	All uses updated.
	* nat/i386-dregs.h (i386_dr_show): Removed.
	(i386_dr_length_and_rw_bits): Likewise.
	(i386_dr_insert_aligned_watchpoint): Likewise.
	(i386_dr_remove_aligned_watchpoint): Likewise.
	(i386_dr_update_inferior_debug_regs): Likewise.

gdb/gdbserver/
2014-06-19  Gary Benson  <gbenson@redhat.com>

	* i386-low.c (i386_dr_show): Renamed to
	i386_show_dr and made static.  All uses updated.
	(i386_dr_length_and_rw_bits): Renamed to
	i386_length_and_rw_bits and made static.
	All uses updated.
	(i386_dr_insert_aligned_watchpoint): Renamed to
	i386_insert_aligned_watchpoint and made static.
	All uses updated.
	(i386_dr_remove_aligned_watchpoint): Renamed to
	i386_remove_aligned_watchpoint and made static.
	All uses updated.
	(i386_dr_update_inferior_debug_regs): Renamed to
	i386_update_inferior_debug_regs and made static.
	All uses updated.
This commit is contained in:
Gary Benson
2014-06-18 15:17:02 +01:00
parent 992c7d700f
commit 8f26655c9e
5 changed files with 107 additions and 112 deletions

View File

@ -1,3 +1,25 @@
2014-06-19 Gary Benson <gbenson@redhat.com>
* i386-nat.c (i386_dr_show): Renamed to
i386_show_dr and made static. All uses updated.
(i386_dr_length_and_rw_bits): Renamed to
i386_length_and_rw_bits and made static.
All uses updated.
(i386_dr_insert_aligned_watchpoint): Renamed to
i386_insert_aligned_watchpoint and made static.
All uses updated.
(i386_dr_remove_aligned_watchpoint): Renamed to
i386_remove_aligned_watchpoint and made static.
All uses updated.
(i386_dr_update_inferior_debug_regs): Renamed to
i386_update_inferior_debug_regs and made static.
All uses updated.
* nat/i386-dregs.h (i386_dr_show): Removed.
(i386_dr_length_and_rw_bits): Likewise.
(i386_dr_insert_aligned_watchpoint): Likewise.
(i386_dr_remove_aligned_watchpoint): Likewise.
(i386_dr_update_inferior_debug_regs): Likewise.
2014-06-19 Gary Benson <gbenson@redhat.com> 2014-06-19 Gary Benson <gbenson@redhat.com>
* configure.ac [AC_CHECK_FUNCS] <sigaltstack>: New check. * configure.ac [AC_CHECK_FUNCS] <sigaltstack>: New check.

View File

@ -1,3 +1,20 @@
2014-06-19 Gary Benson <gbenson@redhat.com>
* i386-low.c (i386_dr_show): Renamed to
i386_show_dr and made static. All uses updated.
(i386_dr_length_and_rw_bits): Renamed to
i386_length_and_rw_bits and made static.
All uses updated.
(i386_dr_insert_aligned_watchpoint): Renamed to
i386_insert_aligned_watchpoint and made static.
All uses updated.
(i386_dr_remove_aligned_watchpoint): Renamed to
i386_remove_aligned_watchpoint and made static.
All uses updated.
(i386_dr_update_inferior_debug_regs): Renamed to
i386_update_inferior_debug_regs and made static.
All uses updated.
2014-06-18 Gary Benson <gbenson@redhat.com> 2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-low.h (i386_dr_low_can_set_addr): New macro. * i386-low.h (i386_dr_low_can_set_addr): New macro.

View File

@ -71,7 +71,7 @@
Currently, all watchpoint are locally enabled. If you need to Currently, all watchpoint are locally enabled. If you need to
enable them globally, read the comment which pertains to this in enable them globally, read the comment which pertains to this in
i386_dr_insert_aligned_watchpoint below. */ i386_insert_aligned_watchpoint below. */
#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit. */ #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_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit. */
#define DR_ENABLE_SIZE 2 /* Two enable bits per debug register. */ #define DR_ENABLE_SIZE 2 /* Two enable bits per debug register. */
@ -163,8 +163,8 @@ i386_low_init_dregs (struct i386_debug_reg_state *state)
/* Print the values of the mirrored debug registers. */ /* Print the values of the mirrored debug registers. */
void static void
i386_dr_show (struct i386_debug_reg_state *state, i386_show_dr (struct i386_debug_reg_state *state,
const char *func, CORE_ADDR addr, const char *func, CORE_ADDR addr,
int len, enum target_hw_bp_type type) int len, enum target_hw_bp_type type)
{ {
@ -204,8 +204,8 @@ i386_dr_show (struct i386_debug_reg_state *state,
region of LEN bytes for accesses of type TYPE. LEN is assumed to region of LEN bytes for accesses of type TYPE. LEN is assumed to
have the value of 1, 2, or 4. */ have the value of 1, 2, or 4. */
unsigned static unsigned
i386_dr_length_and_rw_bits (int len, enum target_hw_bp_type type) i386_length_and_rw_bits (int len, enum target_hw_bp_type type)
{ {
unsigned rw; unsigned rw;
@ -232,7 +232,7 @@ i386_dr_length_and_rw_bits (int len, enum target_hw_bp_type type)
#endif #endif
default: default:
internal_error (__FILE__, __LINE__, _("\ internal_error (__FILE__, __LINE__, _("\
Invalid hardware breakpoint type %d in i386_dr_length_and_rw_bits.\n"), Invalid hardware breakpoint type %d in i386_length_and_rw_bits.\n"),
(int) type); (int) type);
} }
@ -250,7 +250,7 @@ Invalid hardware breakpoint type %d in i386_dr_length_and_rw_bits.\n"),
/* ELSE FALL THROUGH */ /* ELSE FALL THROUGH */
default: default:
internal_error (__FILE__, __LINE__, _("\ internal_error (__FILE__, __LINE__, _("\
Invalid hardware breakpoint length %d in i386_dr_length_and_rw_bits.\n"), len); Invalid hardware breakpoint length %d in i386_length_and_rw_bits.\n"), len);
} }
} }
@ -260,9 +260,9 @@ Invalid hardware breakpoint length %d in i386_dr_length_and_rw_bits.\n"), len);
type of the region to be watched by this watchpoint. Return 0 on type of the region to be watched by this watchpoint. Return 0 on
success, -1 on failure. */ success, -1 on failure. */
int static int
i386_dr_insert_aligned_watchpoint (struct i386_debug_reg_state *state, i386_insert_aligned_watchpoint (struct i386_debug_reg_state *state,
CORE_ADDR addr, unsigned len_rw_bits) CORE_ADDR addr, unsigned len_rw_bits)
{ {
int i; int i;
@ -320,9 +320,9 @@ i386_dr_insert_aligned_watchpoint (struct i386_debug_reg_state *state,
type of the region watched by this watchpoint. Return 0 on type of the region watched by this watchpoint. Return 0 on
success, -1 on failure. */ success, -1 on failure. */
int static int
i386_dr_remove_aligned_watchpoint (struct i386_debug_reg_state *state, i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state,
CORE_ADDR addr, unsigned len_rw_bits) CORE_ADDR addr, unsigned len_rw_bits)
{ {
int i, retval = -1; int i, retval = -1;
@ -392,12 +392,12 @@ i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state,
} }
else else
{ {
unsigned len_rw = i386_dr_length_and_rw_bits (size, type); unsigned len_rw = i386_length_and_rw_bits (size, type);
if (what == WP_INSERT) if (what == WP_INSERT)
retval = i386_dr_insert_aligned_watchpoint (state, addr, len_rw); retval = i386_insert_aligned_watchpoint (state, addr, len_rw);
else if (what == WP_REMOVE) else if (what == WP_REMOVE)
retval = i386_dr_remove_aligned_watchpoint (state, addr, len_rw); retval = i386_remove_aligned_watchpoint (state, addr, len_rw);
else else
internal_error (__FILE__, __LINE__, _("\ internal_error (__FILE__, __LINE__, _("\
Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n"), Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n"),
@ -416,9 +416,9 @@ Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n"),
/* Update the inferior debug registers state, in STATE, with the /* Update the inferior debug registers state, in STATE, with the
new debug registers state, in NEW_STATE. */ new debug registers state, in NEW_STATE. */
void static void
i386_dr_update_inferior_debug_regs (struct i386_debug_reg_state *state, i386_update_inferior_debug_regs (struct i386_debug_reg_state *state,
struct i386_debug_reg_state *new_state) struct i386_debug_reg_state *new_state)
{ {
int i; int i;
@ -463,17 +463,17 @@ i386_dr_insert_watchpoint (struct i386_debug_reg_state *state,
} }
else else
{ {
unsigned len_rw = i386_dr_length_and_rw_bits (len, type); unsigned len_rw = i386_length_and_rw_bits (len, type);
retval = i386_dr_insert_aligned_watchpoint (&local_state, retval = i386_insert_aligned_watchpoint (&local_state,
addr, len_rw); addr, len_rw);
} }
if (retval == 0) if (retval == 0)
i386_dr_update_inferior_debug_regs (state, &local_state); i386_update_inferior_debug_regs (state, &local_state);
if (debug_hw_points) if (debug_hw_points)
i386_dr_show (state, "insert_watchpoint", addr, len, type); i386_show_dr (state, "insert_watchpoint", addr, len, type);
return retval; return retval;
} }
@ -502,17 +502,17 @@ i386_dr_remove_watchpoint (struct i386_debug_reg_state *state,
} }
else else
{ {
unsigned len_rw = i386_dr_length_and_rw_bits (len, type); unsigned len_rw = i386_length_and_rw_bits (len, type);
retval = i386_dr_remove_aligned_watchpoint (&local_state, retval = i386_remove_aligned_watchpoint (&local_state,
addr, len_rw); addr, len_rw);
} }
if (retval == 0) if (retval == 0)
i386_dr_update_inferior_debug_regs (state, &local_state); i386_update_inferior_debug_regs (state, &local_state);
if (debug_hw_points) if (debug_hw_points)
i386_dr_show (state, "remove_watchpoint", addr, len, type); i386_show_dr (state, "remove_watchpoint", addr, len, type);
return retval; return retval;
} }
@ -602,12 +602,12 @@ i386_dr_stopped_data_address (struct i386_debug_reg_state *state,
addr = i386_dr_low_get_addr (i); addr = i386_dr_low_get_addr (i);
rc = 1; rc = 1;
if (debug_hw_points) if (debug_hw_points)
i386_dr_show (state, "watchpoint_hit", addr, -1, hw_write); i386_show_dr (state, "watchpoint_hit", addr, -1, hw_write);
} }
} }
if (debug_hw_points && addr == 0) if (debug_hw_points && addr == 0)
i386_dr_show (state, "stopped_data_addr", 0, 0, hw_write); i386_show_dr (state, "stopped_data_addr", 0, 0, hw_write);
if (rc) if (rc)
*addr_p = addr; *addr_p = addr;

View File

@ -86,7 +86,7 @@ struct i386_dr_low_type i386_dr_low;
Currently, all watchpoint are locally enabled. If you need to Currently, all watchpoint are locally enabled. If you need to
enable them globally, read the comment which pertains to this in enable them globally, read the comment which pertains to this in
i386_dr_insert_aligned_watchpoint below. */ i386_insert_aligned_watchpoint below. */
#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit. */ #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_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit. */
#define DR_ENABLE_SIZE 2 /* Two enable bits per debug register. */ #define DR_ENABLE_SIZE 2 /* Two enable bits per debug register. */
@ -269,8 +269,8 @@ i386_cleanup_dregs (void)
/* Print the values of the mirrored debug registers. */ /* Print the values of the mirrored debug registers. */
void static void
i386_dr_show (struct i386_debug_reg_state *state, i386_show_dr (struct i386_debug_reg_state *state,
const char *func, CORE_ADDR addr, const char *func, CORE_ADDR addr,
int len, enum target_hw_bp_type type) int len, enum target_hw_bp_type type)
{ {
@ -310,8 +310,8 @@ i386_dr_show (struct i386_debug_reg_state *state,
region of LEN bytes for accesses of type TYPE. LEN is assumed to region of LEN bytes for accesses of type TYPE. LEN is assumed to
have the value of 1, 2, or 4. */ have the value of 1, 2, or 4. */
unsigned static unsigned
i386_dr_length_and_rw_bits (int len, enum target_hw_bp_type type) i386_length_and_rw_bits (int len, enum target_hw_bp_type type)
{ {
unsigned rw; unsigned rw;
@ -338,7 +338,7 @@ i386_dr_length_and_rw_bits (int len, enum target_hw_bp_type type)
#endif #endif
default: default:
internal_error (__FILE__, __LINE__, _("\ internal_error (__FILE__, __LINE__, _("\
Invalid hardware breakpoint type %d in i386_dr_length_and_rw_bits.\n"), Invalid hardware breakpoint type %d in i386_length_and_rw_bits.\n"),
(int) type); (int) type);
} }
@ -356,7 +356,7 @@ Invalid hardware breakpoint type %d in i386_dr_length_and_rw_bits.\n"),
/* ELSE FALL THROUGH */ /* ELSE FALL THROUGH */
default: default:
internal_error (__FILE__, __LINE__, _("\ internal_error (__FILE__, __LINE__, _("\
Invalid hardware breakpoint length %d in i386_dr_length_and_rw_bits.\n"), len); Invalid hardware breakpoint length %d in i386_length_and_rw_bits.\n"), len);
} }
} }
@ -366,9 +366,9 @@ Invalid hardware breakpoint length %d in i386_dr_length_and_rw_bits.\n"), len);
type of the region to be watched by this watchpoint. Return 0 on type of the region to be watched by this watchpoint. Return 0 on
success, -1 on failure. */ success, -1 on failure. */
int static int
i386_dr_insert_aligned_watchpoint (struct i386_debug_reg_state *state, i386_insert_aligned_watchpoint (struct i386_debug_reg_state *state,
CORE_ADDR addr, unsigned len_rw_bits) CORE_ADDR addr, unsigned len_rw_bits)
{ {
int i; int i;
@ -426,9 +426,9 @@ i386_dr_insert_aligned_watchpoint (struct i386_debug_reg_state *state,
type of the region watched by this watchpoint. Return 0 on type of the region watched by this watchpoint. Return 0 on
success, -1 on failure. */ success, -1 on failure. */
int static int
i386_dr_remove_aligned_watchpoint (struct i386_debug_reg_state *state, i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state,
CORE_ADDR addr, unsigned len_rw_bits) CORE_ADDR addr, unsigned len_rw_bits)
{ {
int i, retval = -1; int i, retval = -1;
@ -498,12 +498,12 @@ i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state,
} }
else else
{ {
unsigned len_rw = i386_dr_length_and_rw_bits (size, type); unsigned len_rw = i386_length_and_rw_bits (size, type);
if (what == WP_INSERT) if (what == WP_INSERT)
retval = i386_dr_insert_aligned_watchpoint (state, addr, len_rw); retval = i386_insert_aligned_watchpoint (state, addr, len_rw);
else if (what == WP_REMOVE) else if (what == WP_REMOVE)
retval = i386_dr_remove_aligned_watchpoint (state, addr, len_rw); retval = i386_remove_aligned_watchpoint (state, addr, len_rw);
else else
internal_error (__FILE__, __LINE__, _("\ internal_error (__FILE__, __LINE__, _("\
Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n"), Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n"),
@ -522,9 +522,9 @@ Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n"),
/* Update the inferior debug registers state, in STATE, with the /* Update the inferior debug registers state, in STATE, with the
new debug registers state, in NEW_STATE. */ new debug registers state, in NEW_STATE. */
void static void
i386_dr_update_inferior_debug_regs (struct i386_debug_reg_state *state, i386_update_inferior_debug_regs (struct i386_debug_reg_state *state,
struct i386_debug_reg_state *new_state) struct i386_debug_reg_state *new_state)
{ {
int i; int i;
@ -571,17 +571,17 @@ i386_insert_watchpoint (struct target_ops *self,
} }
else else
{ {
unsigned len_rw = i386_dr_length_and_rw_bits (len, type); unsigned len_rw = i386_length_and_rw_bits (len, type);
retval = i386_dr_insert_aligned_watchpoint (&local_state, retval = i386_insert_aligned_watchpoint (&local_state,
addr, len_rw); addr, len_rw);
} }
if (retval == 0) if (retval == 0)
i386_dr_update_inferior_debug_regs (state, &local_state); i386_update_inferior_debug_regs (state, &local_state);
if (debug_hw_points) if (debug_hw_points)
i386_dr_show (state, "insert_watchpoint", addr, len, type); i386_show_dr (state, "insert_watchpoint", addr, len, type);
return retval; return retval;
} }
@ -611,17 +611,17 @@ i386_remove_watchpoint (struct target_ops *self,
} }
else else
{ {
unsigned len_rw = i386_dr_length_and_rw_bits (len, type); unsigned len_rw = i386_length_and_rw_bits (len, type);
retval = i386_dr_remove_aligned_watchpoint (&local_state, retval = i386_remove_aligned_watchpoint (&local_state,
addr, len_rw); addr, len_rw);
} }
if (retval == 0) if (retval == 0)
i386_dr_update_inferior_debug_regs (state, &local_state); i386_update_inferior_debug_regs (state, &local_state);
if (debug_hw_points) if (debug_hw_points)
i386_dr_show (state, "remove_watchpoint", addr, len, type); i386_show_dr (state, "remove_watchpoint", addr, len, type);
return retval; return retval;
} }
@ -714,12 +714,12 @@ i386_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
addr = i386_dr_low_get_addr (i); addr = i386_dr_low_get_addr (i);
rc = 1; rc = 1;
if (debug_hw_points) if (debug_hw_points)
i386_dr_show (state, "watchpoint_hit", addr, -1, hw_write); i386_show_dr (state, "watchpoint_hit", addr, -1, hw_write);
} }
} }
if (debug_hw_points && addr == 0) if (debug_hw_points && addr == 0)
i386_dr_show (state, "stopped_data_addr", 0, 0, hw_write); i386_show_dr (state, "stopped_data_addr", 0, 0, hw_write);
if (rc) if (rc)
*addr_p = addr; *addr_p = addr;
@ -744,20 +744,19 @@ i386_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch,
{ {
struct i386_debug_reg_state *state struct i386_debug_reg_state *state
= i386_debug_reg_state (ptid_get_pid (inferior_ptid)); = i386_debug_reg_state (ptid_get_pid (inferior_ptid));
unsigned len_rw = i386_dr_length_and_rw_bits (1, hw_execute); unsigned len_rw = i386_length_and_rw_bits (1, hw_execute);
CORE_ADDR addr = bp_tgt->placed_address; CORE_ADDR addr = bp_tgt->placed_address;
/* Work on a local copy of the debug registers, and on success, /* Work on a local copy of the debug registers, and on success,
commit the change back to the inferior. */ commit the change back to the inferior. */
struct i386_debug_reg_state local_state = *state; struct i386_debug_reg_state local_state = *state;
int retval = i386_dr_insert_aligned_watchpoint (&local_state, int retval = i386_insert_aligned_watchpoint (&local_state,
addr, addr, len_rw) ? EBUSY : 0;
len_rw) ? EBUSY : 0;
if (retval == 0) if (retval == 0)
i386_dr_update_inferior_debug_regs (state, &local_state); i386_update_inferior_debug_regs (state, &local_state);
if (debug_hw_points) if (debug_hw_points)
i386_dr_show (state, "insert_hwbp", addr, 1, hw_execute); i386_show_dr (state, "insert_hwbp", addr, 1, hw_execute);
return retval; return retval;
} }
@ -771,19 +770,19 @@ i386_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch,
{ {
struct i386_debug_reg_state *state struct i386_debug_reg_state *state
= i386_debug_reg_state (ptid_get_pid (inferior_ptid)); = i386_debug_reg_state (ptid_get_pid (inferior_ptid));
unsigned len_rw = i386_dr_length_and_rw_bits (1, hw_execute); unsigned len_rw = i386_length_and_rw_bits (1, hw_execute);
CORE_ADDR addr = bp_tgt->placed_address; CORE_ADDR addr = bp_tgt->placed_address;
/* Work on a local copy of the debug registers, and on success, /* Work on a local copy of the debug registers, and on success,
commit the change back to the inferior. */ commit the change back to the inferior. */
struct i386_debug_reg_state local_state = *state; struct i386_debug_reg_state local_state = *state;
int retval = i386_dr_remove_aligned_watchpoint (&local_state, int retval = i386_remove_aligned_watchpoint (&local_state,
addr, len_rw); addr, len_rw);
if (retval == 0) if (retval == 0)
i386_dr_update_inferior_debug_regs (state, &local_state); i386_update_inferior_debug_regs (state, &local_state);
if (debug_hw_points) if (debug_hw_points)
i386_dr_show (state, "remove_hwbp", addr, 1, hw_execute); i386_show_dr (state, "remove_hwbp", addr, 1, hw_execute);
return retval; return retval;
} }

View File

@ -60,8 +60,6 @@ struct i386_debug_reg_state
/* A macro to loop over all debug registers. */ /* A macro to loop over all debug registers. */
#define ALL_DEBUG_REGISTERS(i) for (i = 0; i < DR_NADDR; i++) #define ALL_DEBUG_REGISTERS(i) for (i = 0; i < DR_NADDR; i++)
/* High-level functions. */
/* Insert a watchpoint to watch a memory region which starts at /* Insert a watchpoint to watch a memory region which starts at
address ADDR and whose length is LEN bytes. Watch memory accesses address ADDR and whose length is LEN bytes. Watch memory accesses
@ -93,46 +91,5 @@ extern int i386_dr_stopped_data_address (struct i386_debug_reg_state *state,
/* Return true if the inferior has some watchpoint that triggered. /* Return true if the inferior has some watchpoint that triggered.
Otherwise return false. */ Otherwise return false. */
extern int i386_dr_stopped_by_watchpoint (struct i386_debug_reg_state *state); extern int i386_dr_stopped_by_watchpoint (struct i386_debug_reg_state *state);
/* Low-level functions. */
/* Print the values of the mirrored debug registers. */
extern void i386_dr_show (struct i386_debug_reg_state *state,
const char *func, CORE_ADDR addr,
int len, enum target_hw_bp_type type);
/* Return the value of a 4-bit field for DR7 suitable for watching a
region of LEN bytes for accesses of type TYPE. LEN is assumed to
have the value of 1, 2, or 4. */
extern unsigned i386_dr_length_and_rw_bits (int len,
enum target_hw_bp_type type);
/* Insert a watchpoint at address ADDR, which is assumed to be aligned
according to the length of the region to watch. LEN_RW_BITS is the
value of the bits from DR7 which describes the length and access
type of the region to be watched by this watchpoint. Return 0 on
success, -1 on failure. */
extern int i386_dr_insert_aligned_watchpoint (struct i386_debug_reg_state *state,
CORE_ADDR addr,
unsigned len_rw_bits);
/* Remove a watchpoint at address ADDR, which is assumed to be aligned
according to the length of the region to watch. LEN_RW_BITS is the
value of the bits from DR7 which describes the length and access
type of the region watched by this watchpoint. Return 0 on
success, -1 on failure. */
extern int i386_dr_remove_aligned_watchpoint (struct i386_debug_reg_state *state,
CORE_ADDR addr,
unsigned len_rw_bits);
/* Update the inferior debug registers state, in STATE, with the
new debug registers state, in NEW_STATE. */
extern void i386_dr_update_inferior_debug_regs (struct i386_debug_reg_state *state,
struct i386_debug_reg_state *new_state);
#endif /* I386_DREGS_H */ #endif /* I386_DREGS_H */