This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix gdb.arch/aarch64-dbreg-contents.exp build failures
- From: Alan Hayward <Alan dot Hayward at arm dot com>
- To: Luis Machado <luis dot machado at linaro dot org>
- Cc: gdb-patches <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Wed, 26 Feb 2020 11:46:28 +0000
- Subject: Re: [PATCH] Fix gdb.arch/aarch64-dbreg-contents.exp build failures
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iKUsFfLcaKIQW9FfVyE0KkanS+Qn0HVevcDGe5YxD64=; b=Y8i4aR3Y6BJoM7SPrkYY34/T7Q0ogNC4LXkTdv8DpinMGRFBEYcyHTEH5Oq6mBsF+M4MzBzZ5mZCsxSjo++xlAegSqAIrLsHqztkUSFne/PBzqW6wxZ3GuqwpIjsEJ3Vqnzt3PAQ65jH0v5aImQchD1RYa5NW7AqwT5T/E16mg0ZrDghcTvmhhQi2X/OouzNYgcN9GyV+GqRiYWdqjR2oW8Ftpv3AJ0HNYJ4m0jnmKBpLNVX3La3civdQU2HMOHtILFBqMvtBMBItJaM8ym0wSPZAPE+zGL6AeY8xAPmT7BBSf1epkfUKY4wzQlFppHvQ0TdaedrLO1rpAfvjL2+hw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RPhfUvntUe2TRGEaY6QoPvebJO7gjjFzhaB4efOONnD1JvWzPyVEcVGu+xPJjkvzkyLwr+5EQ/Sk/aWsehDju0J36h5ol5bHyEbWvKcBxxwO0cF0QeFSL5Vd8O1AKhZFCY27Jdd0DPDYyvc0FdCuOWvzPBtxkP2zLnFdlp2vx72LmdjGzAVRFTjFY63JSQd74izzDLdXTpKjfFV6TPCisKuahMx/9FkWA4zQmj2RI5F+qP7W8Bq/079MX2HrtCw9Oga3GtKQ808VECiMfw7fbpbCBpnbx9akCrmcOkWMSSXpXxf1tCs+NDuofkC6EulLi6CyDwIqk4pnawa1f1HFJw==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan dot Hayward at arm dot com;
- References: <20200225131532.5796-1-luis.machado@linaro.org>
> On 25 Feb 2020, at 13:15, Luis Machado <luis.machado@linaro.org> wrote:
>
> I ran into the following failures when running tests under QEMU:
>
> --
>
> gdb compile failed, binutils-gdb/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.c: In function 'set_watchpoint':
> binutils-gdb/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.c:41:29: error: storage size of 'dreg_state' isn't known
> struct user_hwdebug_state dreg_state;
> ^~~~~~~~~~
> In file included from /usr/include/aarch64-linux-gnu/bits/types/struct_iovec.h:23:0,
> from /usr/include/aarch64-linux-gnu/sys/uio.h:23,
> from binutils-gdb/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.c:17:
> binutils-gdb/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.c:69:18: error: invalid use of undefined type 'struct user_hwdebug_state'
> iov.iov_len = (offsetof (struct user_hwdebug_state, dbg_regs)
> ^
> binutils-gdb/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.c:74:5: warning: implicit declaration of function 'error'; did you mean 'errno'? [-Wimplicit-function-declaration]
> error (1, errno, "PTRACE_SETREGSET: NT_ARM_HW_WATCH");
> ^~~~~
> errno
> binutils-gdb/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.c: In function 'main':
> binutils-gdb/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.c:87:3: warning: implicit declaration of function 'atexit'; did you mean '_Exit'? [-Wimplicit-function-declaration]
> atexit (cleanup);
> ^~~~~~
> _Exit
> binutils-gdb/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.c:89:11: warning: implicit declaration of function 'fork' [-Wimplicit-function-declaration]
> child = fork ();
>
> ^~~~
>
> --
>
> The following patch fixes those by adding the necessary include files.
>
> With that said, the test doesn't pass at present. I'll have to investigate it
> a bit more.
>
> gdb/testsuite/ChangeLog:
>
> 2020-02-25 Luis Machado <luis.machado@linaro.org>
>
> * gdb.arch/aarch64-dbreg-contents.c: Include stdlib.h, unistd,
> asm/ptrace.h and error.h.
>
> Signed-off-by: Luis Machado <luis.machado@linaro.org>
> ---
> gdb/testsuite/gdb.arch/aarch64-dbreg-contents.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.c b/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.c
> index 66ca76f847..ca690f63de 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.c
> +++ b/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.c
> @@ -9,13 +9,17 @@
> freely. */
>
> #define _GNU_SOURCE 1
> +#include <stdlib.h>
> +#include <unistd.h>
> #include <sys/ptrace.h>
> +#include <asm/ptrace.h>
I get a little concerned when we have to include multiple sys, asm, bits etc
version of a header. However, saying that we include both of these in many
aarch64 gdb files (eg aarch64-linux-hw-point.c).
Ok to push.
> #include <assert.h>
> #include <sys/wait.h>
> #include <stddef.h>
> #include <errno.h>
> #include <sys/uio.h>
> #include <elf.h>
> +#include <error.h>
>
> static pid_t child;
>
> --
> 2.17.1
>