This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] gdbserver: Add linux_get_hwcap
- From: Peter Bergner <bergner at linux dot ibm dot com>
- To: Alan Hayward <Alan dot Hayward at arm dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Tue, 2 Apr 2019 17:00:32 -0500
- Subject: Re: [PATCH 2/2] gdbserver: Add linux_get_hwcap
- References: <20190325120542.92123-1-alan.hayward@arm.com> <20190325120542.92123-2-alan.hayward@arm.com>
On 3/25/19 7:05 AM, Alan Hayward wrote:
> * linux-ppc-low.c (ppc_get_auxv): Remove function.
[snip]
> diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
> index 1b695e53fe..8deb0ce068 100644
> --- a/gdb/gdbserver/linux-ppc-low.c
> +++ b/gdb/gdbserver/linux-ppc-low.c
> @@ -323,43 +323,6 @@ ppc_set_pc (struct regcache *regcache, CORE_ADDR pc)
> }
> }
>
> -
> -static int
> -ppc_get_auxv (unsigned long type, unsigned long *valp)
> -{
> - const struct target_desc *tdesc = current_process ()->tdesc;
> - int wordsize = register_size (tdesc, 0);
> - unsigned char *data = (unsigned char *) alloca (2 * wordsize);
> - int offset = 0;
> -
> - while ((*the_target->read_auxv) (offset, data, 2 * wordsize) == 2 * wordsize)
> - {
> - if (wordsize == 4)
> - {
> - unsigned int *data_p = (unsigned int *)data;
> - if (data_p[0] == type)
> - {
> - *valp = data_p[1];
> - return 1;
> - }
> - }
> - else
> - {
> - unsigned long *data_p = (unsigned long *)data;
> - if (data_p[0] == type)
> - {
> - *valp = data_p[1];
> - return 1;
> - }
> - }
> -
> - offset += 2 * wordsize;
> - }
> -
> - *valp = 0;
> - return 0;
> -}
> -
> #ifndef __powerpc64__
> static int ppc_regmap_adjusted;
> #endif
> @@ -944,8 +907,8 @@ ppc_arch_setup (void)
>
> /* The value of current_process ()->tdesc needs to be set for this
> call. */
> - ppc_get_auxv (AT_HWCAP, &ppc_hwcap);
> - ppc_get_auxv (AT_HWCAP2, &ppc_hwcap2);
> + ppc_hwcap = linux_get_hwcap (features.wordsize);
> + ppc_hwcap2 = linux_get_hwcap2 (features.wordsize);
>
> features.isa205 = ppc_linux_has_isa205 (ppc_hwcap);
>
You have removed ppc_get_auxv(), but I'm still seeing uses of it that
function which are causing build errors (powerpc64le-linux):
/home/bergner/binutils/binutils-gdb/gdb/gdbserver/linux-ppc-low.c: In function ‘int is_elfv2_inferior()’:
/home/bergner/binutils/binutils-gdb/gdb/gdbserver/linux-ppc-low.c:1113:8: error: ‘ppc_get_auxv’ was not declared in this scope
if (!ppc_get_auxv (AT_PHDR, &phdr))
Peter