diff options
author | Gary Benson <gbenson@redhat.com> | 2014-06-16 15:06:09 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2014-06-18 10:15:25 +0100 |
commit | 131aa0d4fe4126c53dcb3a73217a39578b73f2ea (patch) | |
tree | 56c0a0764acdf959a3f4dce7de0295a16b5b6734 /gdb/gdbserver | |
parent | d9305f7fef566159dd940a11155107407f43ec15 (diff) | |
download | gdb-131aa0d4fe4126c53dcb3a73217a39578b73f2ea.zip gdb-131aa0d4fe4126c53dcb3a73217a39578b73f2ea.tar.gz gdb-131aa0d4fe4126c53dcb3a73217a39578b73f2ea.tar.bz2 |
Abstract i386_dr_low access
This commit adds macros to abstract access to the i386_dr_low
function vector used by i386-nat.c. The macros are named so
as to match the names of the functions that do the same work
in gdbserver.
gdb/
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-nat.c (i386_dr_low_can_set_addr): New macro.
(i386_dr_low_can_set_control): Likewise.
(i386_dr_low_set_addr): Likewise.
(i386_dr_low_set_control): Likewise.
(i386_dr_low_get_addr): Likewise.
(i386_dr_low_get_status): Likewise.
(i386_dr_low_get_control): Likewise.
(i386_insert_aligned_watchpoint): Use new macros.
(i386_update_inferior_debug_regs): Likewise.
(i386_stopped_data_address): Likewise.
gdb/gdbserver/
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-low.c (i386_dr_low_can_set_addr): New macro.
(i386_dr_low_can_set_control): Likewise.
(i386_insert_aligned_watchpoint): New check.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/gdbserver/i386-low.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 7c72043..8fb0e07 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,11 @@ 2014-06-18 Gary Benson <gbenson@redhat.com> + * i386-low.c (i386_dr_low_can_set_addr): New macro. + (i386_dr_low_can_set_control): Likewise. + (i386_insert_aligned_watchpoint): New check. + +2014-06-18 Gary Benson <gbenson@redhat.com> + * i386-low.c (i386_update_inferior_debug_regs) <inf_state>: Renamed to state. diff --git a/gdb/gdbserver/i386-low.c b/gdb/gdbserver/i386-low.c index 8c50838..8d6f26c 100644 --- a/gdb/gdbserver/i386-low.c +++ b/gdb/gdbserver/i386-low.c @@ -32,6 +32,9 @@ The functions below implement debug registers sharing by reference counts, and allow to watch regions up to 16 bytes long. */ +#define i386_dr_low_can_set_addr() 1 +#define i386_dr_low_can_set_control() 1 + /* Debug register size, in bytes. */ /* NOTE: sizeof (long) == 4 on win64. */ #define i386_get_debug_register_length() (sizeof (void *)) @@ -273,6 +276,9 @@ i386_insert_aligned_watchpoint (struct i386_debug_reg_state *state, { int i; + if (!i386_dr_low_can_set_addr () || !i386_dr_low_can_set_control ()) + return -1; + /* First, look for an occupied debug register with the same address and the same RW and LEN definitions. If we find one, we can reuse it for this watchpoint as well (and save a register). */ |