aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-04-24 06:48:01 -0600
committerTom Tromey <tromey@adacore.com>2020-04-24 06:48:01 -0600
commit7be2bb4f47b7b25d4f60b52f6ebaade0644827f2 (patch)
tree193917cb4296ca3d8a8a65aafc570768398a4972 /gdb/nat
parent884287754e8da49581b4873b936d8eba7b1f052e (diff)
downloadgdb-7be2bb4f47b7b25d4f60b52f6ebaade0644827f2.zip
gdb-7be2bb4f47b7b25d4f60b52f6ebaade0644827f2.tar.gz
gdb-7be2bb4f47b7b25d4f60b52f6ebaade0644827f2.tar.bz2
Fix Windows debugging regression
The updated pending stop series introduced a regression in Windows debugging. When stopped at a software breakpoint, we would adjust the PC each time it was requested -- however, more than a single adjustment is incorrect. This patch introduces a new flag that is used to ensure the adjustment only happens a single time. No similar change is needed in gdbserver, because it adjusts the PC in a different way. I still can't run the gdb test suite on Windows, but I can run the internal AdaCore test suite there; and this fixes the regressions there. gdb/ChangeLog 2020-04-24 Tom Tromey <tromey@adacore.com> * nat/windows-nat.h (struct windows_thread_info) <pc_adjusted>: New member. * windows-nat.c (windows_fetch_one_register): Check pc_adjusted. (windows_nat_target::get_windows_debug_event) (windows_nat_target::wait): Set pc_adjusted.
Diffstat (limited to 'gdb/nat')
-rw-r--r--gdb/nat/windows-nat.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h
index 8d0fa9b..80c652b 100644
--- a/gdb/nat/windows-nat.h
+++ b/gdb/nat/windows-nat.h
@@ -93,6 +93,11 @@ struct windows_thread_info
breakpoint. This is used to offset the PC when needed. */
bool stopped_at_software_breakpoint = false;
+ /* True if we've adjusted the PC after hitting a software
+ breakpoint, false otherwise. This lets us avoid multiple
+ adjustments if the registers are read multiple times. */
+ bool pc_adjusted = false;
+
/* The name of the thread, allocated by xmalloc. */
gdb::unique_xmalloc_ptr<char> name;
};