+2014-09-03 Gary Benson <gbenson@redhat.com>
+
+ * 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.
+
2014-09-03 Joel Brobecker <brobecker@adacore.com>
* dwarf2loc.h (dwarf2_evaluate_property): Minor function
+2014-09-03 Gary Benson <gbenson@redhat.com>
+
+ * linux-x86-low.c (x86_linux_prepare_to_resume): Use
+ ALL_DEBUG_ADDRESS_REGISTERS.
+
2014-09-02 Gary Benson <gbenson@redhat.com>
* i386-low.h: Renamed as...
x86_linux_dr_set (ptid, DR_CONTROL, 0);
- for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++)
+ ALL_DEBUG_ADDRESS_REGISTERS (i)
if (state->dr_ref_count[i] > 0)
{
x86_linux_dr_set (ptid, i, state->dr_mirror[i]);
{
int i;
- ALL_DEBUG_REGISTERS (i)
+ ALL_DEBUG_ADDRESS_REGISTERS (i)
{
state->dr_mirror[i] = 0;
state->dr_ref_count[i] = 0;
debug_printf ("\tCONTROL (DR7): %s STATUS (DR6): %s\n",
phex (state->dr_control_mirror, 8),
phex (state->dr_status_mirror, 8));
- ALL_DEBUG_REGISTERS (i)
+ ALL_DEBUG_ADDRESS_REGISTERS (i)
{
debug_printf ("\
\tDR%d: addr=0x%s, ref.count=%d DR%d: addr=0x%s, ref.count=%d\n",
/* 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). */
- ALL_DEBUG_REGISTERS (i)
+ ALL_DEBUG_ADDRESS_REGISTERS (i)
{
if (!X86_DR_VACANT (state, i)
&& state->dr_mirror[i] == addr
}
/* Next, look for a vacant debug register. */
- ALL_DEBUG_REGISTERS (i)
+ ALL_DEBUG_ADDRESS_REGISTERS (i)
{
if (X86_DR_VACANT (state, i))
break;
int i, retval = -1;
int all_vacant = 1;
- ALL_DEBUG_REGISTERS (i)
+ ALL_DEBUG_ADDRESS_REGISTERS (i)
{
if (!X86_DR_VACANT (state, i)
&& state->dr_mirror[i] == addr
{
int i;
- ALL_DEBUG_REGISTERS (i)
+ ALL_DEBUG_ADDRESS_REGISTERS (i)
{
if (X86_DR_VACANT (new_state, i) != X86_DR_VACANT (state, i))
x86_dr_low_set_addr (new_state, i);
registers. */
status = x86_dr_low_get_status ();
- ALL_DEBUG_REGISTERS (i)
+ ALL_DEBUG_ADDRESS_REGISTERS (i)
{
if (!X86_DR_WATCH_HIT (status, i))
continue;
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
results in EINVAL. */
x86_linux_dr_set (lwp->ptid, DR_CONTROL, 0);
- for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++)
+ ALL_DEBUG_ADDRESS_REGISTERS (i)
if (state->dr_ref_count[i] > 0)
{
x86_linux_dr_set (lwp->ptid, i, state->dr_mirror[i]);