+2011-11-07 Joel Brobecker <brobecker@adacore.com>
+
+ * win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
+ (i386_dr_low_get_control, i386_dr_low_get_status): Use
+ dr_status_mirror and dr_control_mirror from debug_reg_state.
+ (i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
+ (i386_initial_stuff): Remove use of deleted globals.
+ (i386_get_thread_context, i386_set_thread_context,
+ i386_thread_added): Use dr_status_mirror and dr_control_mirror
+ from debug_reg_state.
+
2011-11-05 Yao Qi <yao@codesourcery.com>
* tracepoint.c (gdb_collect): Loop over tracepoints of same
#endif
static struct i386_debug_reg_state debug_reg_state;
-static unsigned dr_status_mirror;
-static unsigned dr_control_mirror;
static int debug_registers_changed = 0;
static int debug_registers_used = 0;
unsigned
i386_dr_low_get_control (void)
{
- return dr_control_mirror;
+ return debug_reg_state.dr_control_mirror;
}
/* Get the value of the DR6 debug status register from the inferior
{
/* We don't need to do anything here, the last call to thread_rec for
current_event.dwThreadId id has already set it. */
- return dr_status_mirror;
+ return debug_reg_state.dr_status_mirror;
}
/* Watchpoint support. */
i386_low_init_dregs (&debug_reg_state);
debug_registers_changed = 0;
debug_registers_used = 0;
- dr_status_mirror = 0;
- dr_control_mirror = 0;
}
static void
dr->dr_mirror[1] = th->context.Dr1;
dr->dr_mirror[2] = th->context.Dr2;
dr->dr_mirror[3] = th->context.Dr3;
- dr_status_mirror = th->context.Dr6;
- dr_control_mirror = th->context.Dr7;
+ dr->dr_status_mirror = th->context.Dr6;
+ dr->dr_control_mirror = th->context.Dr7;
}
}
th->context.Dr1 = dr->dr_mirror[1];
th->context.Dr2 = dr->dr_mirror[2];
th->context.Dr3 = dr->dr_mirror[3];
- /* th->context.Dr6 = dr_status_mirror;
+ /* th->context.Dr6 = dr->dr_status_mirror;
FIXME: should we set dr6 also ?? */
- th->context.Dr7 = dr_control_mirror;
+ th->context.Dr7 = dr->dr_control_mirror;
}
SetThreadContext (th->h, &th->context);
th->context.Dr1 = dr->dr_mirror[1];
th->context.Dr2 = dr->dr_mirror[2];
th->context.Dr3 = dr->dr_mirror[3];
- /* th->context.Dr6 = dr_status_mirror;
+ /* th->context.Dr6 = dr->dr_status_mirror;
FIXME: should we set dr6 also ?? */
- th->context.Dr7 = dr_control_mirror;
+ th->context.Dr7 = dr->dr_control_mirror;
SetThreadContext (th->h, &th->context);
th->context.ContextFlags = 0;