aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat
diff options
context:
space:
mode:
authorHannes Domani <ssbssa@yahoo.de>2020-04-09 16:33:20 +0200
committerHannes Domani <ssbssa@yahoo.de>2020-04-10 13:01:31 +0200
commit13302e956fb7a0c700f53f16d985c9e6207e331c (patch)
tree3fd9fe1b448cd685717fabccbc62e31ca2fd5e1d /gdb/nat
parenta5d214978ffff7d4b3df9b89706c1df4f0ecd64e (diff)
downloadgdb-13302e956fb7a0c700f53f16d985c9e6207e331c.zip
gdb-13302e956fb7a0c700f53f16d985c9e6207e331c.tar.gz
gdb-13302e956fb7a0c700f53f16d985c9e6207e331c.tar.bz2
Fix debugging of WOW64 processes
The new code regarding pending stops only checks for EXCEPTION_BREAKPOINT, but for WOW64 processes STATUS_WX86_BREAKPOINT is necessary as well. Also, ignore_first_breakpoint is used now in nat/windows-nat.c as well, but was not available there. gdb/ChangeLog: 2020-04-10 Hannes Domani <ssbssa@yahoo.de> * nat/windows-nat.c (STATUS_WX86_BREAKPOINT, STATUS_WX86_SINGLE_STEP): Move to... * nat/windows-nat.h (STATUS_WX86_BREAKPOINT, STATUS_WX86_SINGLE_STEP): ... here. * windows-nat.c (windows_nat_target::get_windows_debug_event): Check for STATUS_WX86_BREAKPOINT. (windows_nat_target::wait): Same.
Diffstat (limited to 'gdb/nat')
-rw-r--r--gdb/nat/windows-nat.c7
-rw-r--r--gdb/nat/windows-nat.h8
2 files changed, 12 insertions, 3 deletions
diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c
index 94e7f57..cd7c1d1 100644
--- a/gdb/nat/windows-nat.c
+++ b/gdb/nat/windows-nat.c
@@ -20,9 +20,6 @@
#include "nat/windows-nat.h"
#include "gdbsupport/common-debug.h"
-#define STATUS_WX86_BREAKPOINT 0x4000001F
-#define STATUS_WX86_SINGLE_STEP 0x4000001E
-
namespace windows_nat
{
@@ -44,6 +41,10 @@ DWORD desired_stop_thread_id = -1;
std::vector<pending_stop> pending_stops;
EXCEPTION_RECORD siginfo_er;
+#ifdef __x86_64__
+bool ignore_first_breakpoint = false;
+#endif
+
/* Note that 'debug_events' must be locally defined in the relevant
functions. */
#define DEBUG_EVENTS(x) if (debug_events) debug_printf x
diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h
index 0597120..aea1519 100644
--- a/gdb/nat/windows-nat.h
+++ b/gdb/nat/windows-nat.h
@@ -25,6 +25,9 @@
#include "gdbsupport/gdb_optional.h"
#include "target/waitstatus.h"
+#define STATUS_WX86_BREAKPOINT 0x4000001F
+#define STATUS_WX86_SINGLE_STEP 0x4000001E
+
namespace windows_nat
{
@@ -202,6 +205,11 @@ extern std::vector<pending_stop> pending_stops;
/* Contents of $_siginfo */
extern EXCEPTION_RECORD siginfo_er;
+#ifdef __x86_64__
+/* Ignore first breakpoint exception of WOW64 process */
+extern bool ignore_first_breakpoint;
+#endif
+
/* Return the name of the DLL referenced by H at ADDRESS. UNICODE
determines what sort of string is read from the inferior. Returns
the name of the DLL, or NULL on error. If a name is returned, it