aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/win32-low.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2021-09-08 08:20:29 -0600
committerTom Tromey <tromey@adacore.com>2022-06-07 09:59:41 -0600
commitbcb9251f029da8dcf360a4f5acfa3b4211c87bb0 (patch)
treec56395b22b1c8ceb3ef8d010c61a4e14c9ee5295 /gdbserver/win32-low.h
parent8fea1a81c7d9279a6f91e49ebacfb61e0f8ce008 (diff)
downloadgdb-bcb9251f029da8dcf360a4f5acfa3b4211c87bb0.zip
gdb-bcb9251f029da8dcf360a4f5acfa3b4211c87bb0.tar.gz
gdb-bcb9251f029da8dcf360a4f5acfa3b4211c87bb0.tar.bz2
Allow ASLR to be disabled on Windows
On Windows, it is possible to disable ASLR when creating a process. This patch adds code to do this, and hooks it up to gdb's existing disable-randomization feature. Because the Windows documentation cautions that this isn't available on all versions of Windows, the CreateProcess wrapper function is updated to make the attempt, and then fall back to the current approach if it fails.
Diffstat (limited to 'gdbserver/win32-low.h')
-rw-r--r--gdbserver/win32-low.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdbserver/win32-low.h b/gdbserver/win32-low.h
index d16f1f9..b29e8b3 100644
--- a/gdbserver/win32-low.h
+++ b/gdbserver/win32-low.h
@@ -165,6 +165,11 @@ public:
{ return true; }
const char *pid_to_exec_file (int pid) override;
+
+ bool supports_disable_randomization () override
+ {
+ return windows_nat::disable_randomization_available ();
+ }
};
/* The sole Windows process. */