aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/i386-low.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2010-08-25 14:40:21 +0000
committerPedro Alves <palves@redhat.com>2010-08-25 14:40:21 +0000
commit964e4306f80f7da4474eea57ce49492b73611acb (patch)
treea808e253ab7d90c5d2f355039eb559f32cd14156 /gdb/gdbserver/i386-low.h
parent4563a8602899e7270a6a0d8dd5da822c6680c6ba (diff)
downloadgdb-964e4306f80f7da4474eea57ce49492b73611acb.zip
gdb-964e4306f80f7da4474eea57ce49492b73611acb.tar.gz
gdb-964e4306f80f7da4474eea57ce49492b73611acb.tar.bz2
PR threads/10729
* linux-x86-low.c (update_debug_registers_callback): New. (i386_dr_low_set_addr): Use it. (i386_dr_low_get_addr): New. (i386_dr_low_set_control): Use update_debug_registers_callback. (i386_dr_low_get_control): New. (i386_dr_low_get_status): Adjust. * linux-low.c (linux_stop_lwp): New. * linux-low.h (linux_stop_lwp): Declare. * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as argument instead of a i386_debug_reg_state. (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of a i386_debug_reg_state. (i386_insert_aligned_watchpoint): Adjust. (i386_remove_aligned_watchpoint): Adjust. (i386_low_stopped_data_address): Read the debug registers from the inferior instead of from the mirrors. * i386-low.h (struct i386_debug_reg_state): Extend comment. (i386_dr_low_get_addr): Declare. (i386_dr_low_get_control): Declare. (i386_dr_low_get_status): Change prototype. * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals. (i386_dr_low_get_addr): New. (i386_dr_low_get_control): New. (i386_dr_low_get_status): Adjust prototype. Return dr_status_mirror. (i386_initial_stuff): Clear dr_status_mirror and dr_control_mirror. (i386_get_thread_context): Adjust. (i386_set_thread_context): Adjust. (i386_thread_added): Adjust.
Diffstat (limited to 'gdb/gdbserver/i386-low.h')
-rw-r--r--gdb/gdbserver/i386-low.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/gdb/gdbserver/i386-low.h b/gdb/gdbserver/i386-low.h
index 7f7f76b..2566b7b 100644
--- a/gdb/gdbserver/i386-low.h
+++ b/gdb/gdbserver/i386-low.h
@@ -42,7 +42,10 @@
struct i386_debug_reg_state
{
/* Mirror the inferior's DRi registers. We keep the status and
- control registers separated because they don't hold addresses. */
+ control registers separated because they don't hold addresses.
+ Note that since we can change these mirrors while threads are
+ running, we never trust them to explain a cause of a trap.
+ For that, we need to peek directly in the inferior registers. */
CORE_ADDR dr_mirror[DR_NADDR];
unsigned dr_status_mirror, dr_control_mirror;
@@ -100,9 +103,14 @@ extern int i386_low_stopped_by_watchpoint (struct i386_debug_reg_state *state);
extern void i386_dr_low_set_addr (const struct i386_debug_reg_state *state,
int regnum);
+/* Return the inferior's debug register REGNUM. */
+extern CORE_ADDR i386_dr_low_get_addr (int regnum);
+
/* Update the inferior's DR7 debug control register from STATE. */
extern void i386_dr_low_set_control (const struct i386_debug_reg_state *state);
-/* Get the value of the inferior's DR6 debug status register
- and record it in STATE. */
-extern void i386_dr_low_get_status (struct i386_debug_reg_state *state);
+/* Return the value of the inferior's DR7 debug control register. */
+extern unsigned i386_dr_low_get_control (void);
+
+/* Return the value of the inferior's DR6 debug status register. */
+extern unsigned i386_dr_low_get_status (void);