diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2011-10-07 12:06:43 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2011-10-07 12:06:43 +0000 |
commit | 77853e1004797f805b76232db99504a3e8f5ca35 (patch) | |
tree | 1023dce6f7cad09e1d736238e1a77df3dfd0af82 /gdb/gdbserver/configure | |
parent | 5a9f5038d4fd3f1362e4983d78ff696a22c2e084 (diff) | |
download | gdb-77853e1004797f805b76232db99504a3e8f5ca35.tar.gz |
* inferior.h (disable_randomization): Declare.
* infrun.c (disable_randomization): New global variable.
(show_disable_randomization): New function.
(set_disable_randomization): Likewise.
(_initialize_infrun): Install set/show disable-randomization
commands.
* linux-nat.c (disable_randomization): Remove.
(show_disable_randomization): Likewise.
(set_disable_randomization): Likewise.
(_initialize_linux_nat): No longer install set/show
disable-randomization commands here.
(linux_nat_supports_disable_randomization): New function.
(linux_nat_add_target): Install it.
* remote.c (PACKET_QDisableRandomization): New enum value.
(remote_protocol_packets): Support QDisableRandomization.
(_initialize_remote): Likewise.
(remote_supports_disable_randomization): New function.
(init_remote_ops): Install it.
(extended_remote_supports_disable_randomization): New function.
(init_extended_remote_ops): Install it.
(extended_remote_disable_randomization): New function.
(extended_remote_create_inferior_1): Call it.
* target.h (struct target_ops): Add to_supports_disable_randomization.
(target_supports_disable_randomization): Add prototype.
* target.c (target_supports_disable_randomization): New function.
(find_default_supports_disable_randomization): Likewise.
(init_dummy_target): Install it.
doc/
* gdb.texinfo (Starting your Program): "set disable-randomization"
is no longer Linux-specific.
(Remote Configuration): Document "set remote
disable-randomization-packet".
(General Query Packets): Document "QDisableRandomization" packet
and add it to "qSupported" list.
gdbserver/
* configure.ac: Check support for personality routine.
* configure: Regenerate.
* config.in: Likewise.
* linux-low.c: Include <sys/personality.h>.
Define ADDR_NO_RANDOMIZE if necessary.
(linux_create_inferior): Disable address space randomization when
forking inferior, if requested.
(linux_supports_disable_randomization): New function.
(linux_target_ops): Install it.
* server.h (disable_randomization): Declare.
* server.c (disable_randomization): New global variable.
(handle_general_set): Handle QDisableRandomization.
(handle_query): Likewise for qSupported.
(main): Support --disable-randomization and --no-disable-randomization
command line arguments.
* target.h (struct target_ops): Add supports_disable_randomization.
(target_supports_disable_randomization): New macro.
Diffstat (limited to 'gdb/gdbserver/configure')
-rwxr-xr-x | gdb/gdbserver/configure | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index c350159e23e..d92a00f3c0e 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -5066,6 +5066,80 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$saved_cflags" +ac_fn_c_check_decl "$LINENO" "ADDR_NO_RANDOMIZE" "ac_cv_have_decl_ADDR_NO_RANDOMIZE" "#include <sys/personality.h> +" +if test "x$ac_cv_have_decl_ADDR_NO_RANDOMIZE" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ADDR_NO_RANDOMIZE $ac_have_decl +_ACEOF + + +if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/personality.h> +int +main () +{ + +# if !HAVE_DECL_ADDR_NO_RANDOMIZE +# define ADDR_NO_RANDOMIZE 0x0040000 +# endif + /* Test the flag could be set and stays set. */ + personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE); + if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE)) + return 1 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gdbsrv_cv_have_personality=true +else + gdbsrv_cv_have_personality=false +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/personality.h> +int +main () +{ + +# if !HAVE_DECL_ADDR_NO_RANDOMIZE +# define ADDR_NO_RANDOMIZE 0x0040000 +# endif + /* Test the flag could be set and stays set. */ + personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE); + if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE)) + return 1 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gdbsrv_cv_have_personality=true +else + gdbsrv_cv_have_personality=false +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +if $gdbsrv_cv_have_personality +then + +$as_echo "#define HAVE_PERSONALITY 1" >>confdefs.h + +fi + IPA_DEPFILES="" extra_libraries="" |