summaryrefslogtreecommitdiff
path: root/gdbserver/win32-low.cc
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.cc
parent8fea1a81c7d9279a6f91e49ebacfb61e0f8ce008 (diff)
downloadbinutils-gdb-bcb9251f029da8dcf360a4f5acfa3b4211c87bb0.tar.gz
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.cc')
-rw-r--r--gdbserver/win32-low.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc
index 00ce2a52feb..a9af6467d7c 100644
--- a/gdbserver/win32-low.cc
+++ b/gdbserver/win32-low.cc
@@ -586,6 +586,7 @@ create_process (const char *program, char *args,
(inferior_cwd.empty ()
? NULL
: gdb_tilde_expand (inferior_cwd.c_str ()).c_str()),
+ get_client_state ().disable_randomization,
&si, /* start info */
pi); /* proc info */