diff options
author | Gary Benson <gbenson@redhat.com> | 2014-09-03 12:05:50 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2014-09-03 12:40:49 +0100 |
commit | 97ea6506c45ab5519483a0221fdc049038496492 (patch) | |
tree | 4aeebec2dfe700ec41d33ba803a88dbb7aa33e27 /gdb/nat/x86-dregs.h | |
parent | d14378154883eb1ae5373e7a73edcc9d97e62634 (diff) | |
download | binutils-97ea6506c45ab5519483a0221fdc049038496492.zip binutils-97ea6506c45ab5519483a0221fdc049038496492.tar.gz binutils-97ea6506c45ab5519483a0221fdc049038496492.tar.bz2 |
x86 debug address register clarifications
The loop macro ALL_DEBUG_REGISTERS does not iterate over the status or
control registers, so its name is misleading. This commit renames it
as ALL_DEBUG_ADDRESS_REGISTERS and updates all uses. This commit also
updates its loop conditions to an equivalent but better form, and
makes two functions use it that had previously hardwired the loop.
A comment on a related field in the x86_debug_reg_state structure is
also updated to reflect that the field refers specifically to address
registers only.
gdb/ChangeLog:
* nat/x86-dregs.h (ALL_DEBUG_REGISTERS): Renamed as...
(ALL_DEBUG_ADDRESS_REGISTERS): New macro. All uses updated.
Loop conditions changed to equivalent form.
(struct x86_debug_reg_state): Updated dr_ref_count comment.
* x86-linux-nat.c (x86_linux_prepare_to_resume): Use
ALL_DEBUG_ADDRESS_REGISTERS.
gdb/gdbserver/ChangeLog:
* linux-x86-low.c (x86_linux_prepare_to_resume): Use
ALL_DEBUG_ADDRESS_REGISTERS.
Diffstat (limited to 'gdb/nat/x86-dregs.h')
-rw-r--r-- | gdb/nat/x86-dregs.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/nat/x86-dregs.h b/gdb/nat/x86-dregs.h index fb179a5..aebcbce 100644 --- a/gdb/nat/x86-dregs.h +++ b/gdb/nat/x86-dregs.h @@ -85,12 +85,13 @@ struct x86_debug_reg_state CORE_ADDR dr_mirror[DR_NADDR]; unsigned dr_status_mirror, dr_control_mirror; - /* Reference counts for each debug register. */ + /* Reference counts for each debug address register. */ int dr_ref_count[DR_NADDR]; }; -/* A macro to loop over all debug registers. */ -#define ALL_DEBUG_REGISTERS(i) for (i = 0; i < DR_NADDR; i++) +/* A macro to loop over all debug address registers. */ +#define ALL_DEBUG_ADDRESS_REGISTERS(i) \ + for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++) /* Insert a watchpoint to watch a memory region which starts at address ADDR and whose length is LEN bytes. Watch memory accesses |