aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2007-12-22 22:09:56 +0000
committerPierre Muller <muller@sourceware.org>2007-12-22 22:09:56 +0000
commit88616312511a24718490296ce93bd1538f392e53 (patch)
treedf428a19edc9b37f5a1ca710468e7c14651d98e3
parent680b30c7fe590e037b8df623e260370c07f8ccda (diff)
downloadfsf-binutils-gdb-88616312511a24718490296ce93bd1538f392e53.zip
fsf-binutils-gdb-88616312511a24718490296ce93bd1538f392e53.tar.gz
fsf-binutils-gdb-88616312511a24718490296ce93bd1538f392e53.tar.bz2
2007-12-22 Pierre Muller <muller@ics.u-strasbg.fr>
* win32-nat.c: Fix PR/2388. (do_win32_fetch_inferior_registers): Do not overwrite debug register array dr if debug_registers_changed variable is set.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/win32-nat.c18
-rw-r--r--gdb/windows-nat.c18
3 files changed, 28 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b5c6508..966013c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2007-12-22 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * win32-nat.c: Fix PR gdb/2388.
+ (do_win32_fetch_inferior_registers): Do not overwrite debug register
+ array dr if debug_registers_changed variable is set.
+
2007-12-22 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2read.c (scan_partial_symbols partial_die_parent_scope)
diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c
index 07ebef9..3e242a4 100644
--- a/gdb/win32-nat.c
+++ b/gdb/win32-nat.c
@@ -382,13 +382,17 @@ do_win32_fetch_inferior_registers (struct regcache *regcache, int r)
thread_info *th = current_thread;
th->context.ContextFlags = CONTEXT_DEBUGGER_DR;
GetThreadContext (th->h, &th->context);
- /* Copy dr values from that thread. */
- dr[0] = th->context.Dr0;
- dr[1] = th->context.Dr1;
- dr[2] = th->context.Dr2;
- dr[3] = th->context.Dr3;
- dr[6] = th->context.Dr6;
- dr[7] = th->context.Dr7;
+ /* Copy dr values from that thread.
+ But only if there were not modified since last stop. PR gdb/2388 */
+ if (!debug_registers_changed)
+ {
+ dr[0] = th->context.Dr0;
+ dr[1] = th->context.Dr1;
+ dr[2] = th->context.Dr2;
+ dr[3] = th->context.Dr3;
+ dr[6] = th->context.Dr6;
+ dr[7] = th->context.Dr7;
+ }
}
current_thread->reload_context = 0;
}
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 07ebef9..3e242a4 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -382,13 +382,17 @@ do_win32_fetch_inferior_registers (struct regcache *regcache, int r)
thread_info *th = current_thread;
th->context.ContextFlags = CONTEXT_DEBUGGER_DR;
GetThreadContext (th->h, &th->context);
- /* Copy dr values from that thread. */
- dr[0] = th->context.Dr0;
- dr[1] = th->context.Dr1;
- dr[2] = th->context.Dr2;
- dr[3] = th->context.Dr3;
- dr[6] = th->context.Dr6;
- dr[7] = th->context.Dr7;
+ /* Copy dr values from that thread.
+ But only if there were not modified since last stop. PR gdb/2388 */
+ if (!debug_registers_changed)
+ {
+ dr[0] = th->context.Dr0;
+ dr[1] = th->context.Dr1;
+ dr[2] = th->context.Dr2;
+ dr[3] = th->context.Dr3;
+ dr[6] = th->context.Dr6;
+ dr[7] = th->context.Dr7;
+ }
}
current_thread->reload_context = 0;
}