[PATCH 2/2] Move code to disable ASR to nat/

Pedro Alves palves@redhat.com
Tue Jan 13 17:11:00 GMT 2015


Hi Sergio,

Thanks.

On 01/09/2015 10:19 PM, Sergio Durigan Junior wrote:
> This patch moves the shared code present on
> gdb/linux-nat.c:linux_nat_create_inferior and
> gdb/gdbserver/linux-low.c:linux_create_inferior to
> nat/linux-personality.c.  This code is responsible for disabling
> address space randomization based on user setting, and using
> <sys/personality.h> to do that.  I decided to put the prototype of the
> maybe_disable_address_space_randomization on nat/linux-osdata.h
> because it seemed the best place to put it.

linux-osdata.h/linux-osdata.c are specifically about TARGET_OBJECT_OSDATA.

How about adding a matching nat/linux-personality.h file?

> --- a/gdb/nat/linux-osdata.h
> +++ b/gdb/nat/linux-osdata.h
> @@ -24,4 +24,6 @@ extern int linux_common_core_of_thread (ptid_t ptid);
>  extern LONGEST linux_common_xfer_osdata (const char *annex, gdb_byte *readbuf,
>  					 ULONGEST offset, ULONGEST len);
>  
> +extern struct cleanup *maybe_disable_address_space_randomization (int disable_randomization);

Line too long.  Write:

extern struct cleanup *maybe_disable_address_space_randomization
  (int disable_randomization);

> +	warning ("Error disabling address space randomization: %s",
> +		 safe_strerror (errno));

i18n.  The GDB version had it.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list