aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2011-10-07 12:06:48 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2011-10-07 12:06:48 +0000
commit03583c206f350870e077f4e112f83b3c4bdd0b27 (patch)
treef21677825f84019f3963478b1f560a497081f4d2 /gdb/doc
parent01b71697807be429fbd5d960e4228c04837024e3 (diff)
downloadgdb-03583c206f350870e077f4e112f83b3c4bdd0b27.zip
gdb-03583c206f350870e077f4e112f83b3c4bdd0b27.tar.gz
gdb-03583c206f350870e077f4e112f83b3c4bdd0b27.tar.bz2
* 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/doc')
-rw-r--r--gdb/doc/ChangeLog9
-rw-r--r--gdb/doc/gdb.texinfo52
2 files changed, 57 insertions, 4 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index a6f8c81..398f347 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,12 @@
+2011-10-07 Ulrich Weigand <ulrich.weigand@linaro.org>
+
+ * 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.
+
2011-10-07 Kevin Pouget <kevin.pouget@st.com>
Allow Python notification of new object-file loadings.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index aad877a..26f6216 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -2044,8 +2044,8 @@ randomization of the virtual address space of the started program. This option
is useful for multiple debugging sessions to make the execution better
reproducible and memory addresses reusable across debugging sessions.
-This feature is implemented only on @sc{gnu}/Linux. You can get the same
-behavior using
+This feature is implemented only on certain targets, including @sc{gnu}/Linux.
+On @sc{gnu}/Linux you can get the same behavior using
@smallexample
(@value{GDBP}) set exec-wrapper setarch `uname -m` -R
@@ -2059,8 +2059,8 @@ disappears when you run the program under @value{GDBN}, that might be because
as @sc{gnu}/Linux, which do that for stand-alone programs. Use @kbd{set
disable-randomization off} to try to reproduce such elusive bugs.
-The virtual address space randomization is implemented only on @sc{gnu}/Linux.
-It protects the programs against some kinds of security attacks. In these
+On targets where it is available, virtual address space randomization
+protects the programs against certain kinds of security attacks. In these
cases the attacker needs to know the exact location of a concrete executable
code. Randomizing its location makes it impossible to inject jumps misusing
a code at its expected addresses.
@@ -16906,6 +16906,10 @@ are:
@item @code{traceframe-info}
@tab @code{qXfer:traceframe-info:read}
@tab Traceframe info
+
+@item @code{disable-randomization}
+@tab @code{QDisableRandomization}
+@tab @code{set disable-randomization}
@end multitable
@node Remote Stub
@@ -33534,6 +33538,38 @@ An error (such as memory fault)
The specified memory region's checksum is @var{crc32}.
@end table
+@item QDisableRandomization:@var{value}
+@cindex disable address space randomization, remote request
+@cindex @samp{QDisableRandomization} packet
+Some target operating systems will randomize the virtual address space
+of the inferior process as a security feature, but provide a feature
+to disable such randomization, e.g.@: to allow for a more deterministic
+debugging experience. On such systems, this packet with a @var{value}
+of 1 directs the target to disable address space randomization for
+processes subsequently started via @samp{vRun} packets, while a packet
+with a @var{value} of 0 tells the target to enable address space
+randomization.
+
+This packet is only available in extended mode (@pxref{extended mode}).
+
+Reply:
+@table @samp
+@item OK
+The request succeeded.
+
+@item E @var{nn}
+An error occurred. @var{nn} are hex digits.
+
+@item
+An empty reply indicates that @samp{QDisableRandomization} is not supported
+by the stub.
+@end table
+
+This packet is not probed by default; the remote stub must request it,
+by supplying an appropriate @samp{qSupported} response (@pxref{qSupported}).
+This should only be done on targets that actually support disabling
+address space randomization.
+
@item qfThreadInfo
@itemx qsThreadInfo
@cindex list active threads, remote request
@@ -34037,6 +34073,11 @@ These are the currently defined stub features and their properties:
@tab @samp{-}
@tab No
+@item @samp{QDisableRandomization}
+@tab No
+@tab @samp{-}
+@tab No
+
@item @samp{EnableDisableTracepoints}
@tab No
@tab @samp{-}
@@ -34154,6 +34195,9 @@ the source form of tracepoint definitions.
@item QAllow
The remote stub understands the @samp{QAllow} packet.
+@item QDisableRandomization
+The remote stub understands the @samp{QDisableRandomization} packet.
+
@item StaticTracepoint
@cindex static tracepoints, in remote protocol
The remote stub supports static tracepoints.