From 4e2aa472847923f94b99f138d7fc4c77796f8239 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 22 Aug 2018 13:37:05 -0400 Subject: [PATCH] Restore behavior of disabling address randomization by default on GDBserver Commit c12a508 ("Add client_state struct.") inadvertently changed the default behavior of GDBserver wrt address randomization. The old disable_randomization global variable was initialized to 1, whereas the corresponding field in the client_state structure is initialized to 0. This fixes make check TESTS="gdb.base/jit-simple.exp" RUNTESTFLAGS="--target_board=native-gdbserver" make check TESTS="gdb.base/execl-update-breakpoints.exp" RUNTESTFLAGS="--target_board=native-gdbserver" Note that the execl-update-breakpoints.exp would only fail on systems where the toolchain emits position-independent executables by default (otherwise the main executable position is never randomized, so the value of disable_randomization didn't matter). gdb/gdbserver/ChangeLog: PR gdb/23374 PR gdb/23375 * server.h (struct client_state) : Initialize to 1. --- gdb/gdbserver/ChangeLog | 7 +++++++ gdb/gdbserver/server.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 66fc16c..ab27e9b 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,10 @@ +2018-08-22 Simon Marchi + + PR gdb/23374 + PR gdb/23375 + * server.h (struct client_state) : + Initialize to 1. + 2018-07-22 Simon Marchi * linux-mips-low.c (mips_collect_ptrace_register): Remove unused diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h index 8e197ee..5e41e2f 100644 --- a/gdb/gdbserver/server.h +++ b/gdb/gdbserver/server.h @@ -176,7 +176,7 @@ struct client_state /* Whether we should attempt to disable the operating system's address space randomization feature before starting an inferior. */ - int disable_randomization = 0; + int disable_randomization = 1; int pass_signals[GDB_SIGNAL_LAST]; int program_signals[GDB_SIGNAL_LAST]; -- 2.7.4