This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] Move code to disable ASR to nat/
- From: Pedro Alves <palves at redhat dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>, GDB Patches <gdb-patches at sourceware dot org>
- Cc: Gary Benson <gbenson at redhat dot com>
- Date: Tue, 13 Jan 2015 17:11:01 +0000
- Subject: Re: [PATCH 2/2] Move code to disable ASR to nat/
- Authentication-results: sourceware.org; auth=none
- References: <1420841943-24290-1-git-send-email-sergiodj at redhat dot com> <1420841943-24290-3-git-send-email-sergiodj at redhat dot com>
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