This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] Move safe_strerror to common/
- 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 16:54:50 +0000
- Subject: Re: [PATCH 1/2] Move safe_strerror to common/
- Authentication-results: sourceware.org; auth=none
- References: <1420841943-24290-1-git-send-email-sergiodj at redhat dot com> <1420841943-24290-2-git-send-email-sergiodj at redhat dot com>
On 01/09/2015 10:19 PM, Sergio Durigan Junior wrote:
> This patch moves safe_strerror from the gdb/{posix,mingw}-hdep.c files
> to the respective common/{posix,mingw}-strerror.c files. This is a
> preparation for the next patch, which shares a common code (to disable
> address space randomization when creating a new inferior).
>
> The patch has been regtested on Fedora 20 x86_64, and no regressions
> were found. I am assuming the MingW modifications are also safe, but
> I have not checked them too deep.
Note, it's "MinGW", capital G. There are instances in the patch of the typo.
>
> --- /dev/null
> +++ b/gdb/common/common.host
> @@ -0,0 +1,17 @@
> +# Mapping of configurations into GDB host definitions. This is
> +# invoked from the autoconf generated configure script.
Copyright header missing. I don't know why configure.host
doesn't have one. Seems like an oversight.
> +
> +# This file sets the following shell variables:
> +# gdb_host_obs host-specific .o files to include when building GDB
> +# srv_host_obs likewise, but when building gdbserver
> +
> +case "${host}" in
> +
> +i[34567]86-*-mingw32*) gdb_host_obs="mingw-hdep.o mingw-strerror.o"
> + srv_host_obs="mingw-strerror.o"
> + ;;
> +x86_64-*-mingw*) gdb_host_obs="mingw-hdep.o mingw-strerror.o"
> + srv_host_obs="mingw-strerror.o"
> + ;;
You can merge those two cases. Let's leave gdb-specific details in gdb proper, etc.
That is, make this file set a common-specific variable, like:
case "${host}" in
*-mingw*) common_host_obs=mingw-strerror.o
;;
*)
common_host_obs=posix-strerror.o
;;
ecas
And then in configure.ac, do:
. $srcdir/common/common.host
gdb_host_obs=$gdb_host_obs $common_host_obs
Thanks,
Pedro Alves