mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
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.
This commit is contained in:
@ -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 */
|
||||
|
||||
|
@ -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. */
|
||||
|
Reference in New Issue
Block a user