From: Alan Hayward <Alan.Hayward@arm.com>
To: Luis Machado <luis.machado@linaro.org>
Cc: "gdb-patches\\@sourceware.org" <gdb-patches@sourceware.org>,
nd <nd@arm.com>
Subject: Re: [PATCH,v2][AArch64] Add more debugging output to aarch64_displaced_step_fixup
Date: Tue, 21 Jan 2020 11:24:00 -0000 [thread overview]
Message-ID: <E71BB843-CD38-42E1-988F-9BCC0976B341@arm.com> (raw)
In-Reply-To: <20200113174239.7819-1-luis.machado@linaro.org>
Ok to push.
Alan.
> On 13 Jan 2020, at 17:42, Luis Machado <luis.machado@linaro.org> wrote:
>
> New in v2:
>
> - Fixed misc comments from review.
>
> --
>
> While debugging the step-over-syscall problem, i wanted to see a bit more
> debugging output to try to determine the root cause.
>
> This patch does this.
>
> gdb/ChangeLog:
>
> 2020-01-13 Luis Machado <luis.machado@linaro.org>
>
> * aarch64-tdep.c (aarch64_displaced_step_fixup): Add more debugging
> output.
> ---
> gdb/aarch64-tdep.c | 27 +++++++++++++++++++++++++--
> 1 file changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
> index 6a9d34dc67..29b712c155 100644
> --- a/gdb/aarch64-tdep.c
> +++ b/gdb/aarch64-tdep.c
> @@ -3037,8 +3037,16 @@ aarch64_displaced_step_fixup (struct gdbarch *gdbarch,
>
> regcache_cooked_read_unsigned (regs, AARCH64_PC_REGNUM, &pc);
>
> + if (debug_displaced)
> + debug_printf ("Displaced: PC after stepping: %s (was %s).\n",
> + paddress (gdbarch, pc), paddress (gdbarch, to));
> +
> if (dsc->cond)
> {
> + if (debug_displaced)
> + debug_printf ("Displaced: [Conditional] pc_adjust before: %d\n",
> + dsc->pc_adjust);
> +
> if (pc - to == 8)
> {
> /* Condition is true. */
> @@ -3050,8 +3058,18 @@ aarch64_displaced_step_fixup (struct gdbarch *gdbarch,
> }
> else
> gdb_assert_not_reached ("Unexpected PC value after displaced stepping");
> +
> + if (debug_displaced)
> + debug_printf ("Displaced: [Conditional] pc_adjust after: %d\n",
> + dsc->pc_adjust);
> }
>
> + if (debug_displaced)
> + debug_printf ("Displaced: %s PC by %d\n",
> + dsc->pc_adjust? "adjusting" : "not adjusting",
> + dsc->pc_adjust);
> +
> +
> if (dsc->pc_adjust != 0)
> {
> /* Make sure the previous instruction was executed (that is, the PC
> @@ -3059,11 +3077,16 @@ aarch64_displaced_step_fixup (struct gdbarch *gdbarch,
> offset. Otherwise we may skip an instruction before its execution
> took place. */
> if ((pc - to) == 0)
> - dsc->pc_adjust = 0;
> + {
> + if (debug_displaced)
> + debug_printf ("Displaced: PC did not move. Discarding PC "
> + "adjustment.\n");
> + dsc->pc_adjust = 0;
> + }
>
> if (debug_displaced)
> {
> - debug_printf ("displaced: fixup: set PC to %s:%d\n",
> + debug_printf ("Displaced: fixup: set PC to %s:%d\n",
> paddress (gdbarch, from), dsc->pc_adjust);
> }
> regcache_cooked_write_unsigned (regs, AARCH64_PC_REGNUM,
> --
> 2.17.1
>
prev parent reply other threads:[~2020-01-21 11:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-13 17:42 Luis Machado
2020-01-13 17:42 ` [PATCH] [AArch64] Convert an int flag variable to bool Luis Machado
2020-01-14 4:25 ` Simon Marchi
2020-01-13 18:21 ` [PATCH,v2][AArch64] Fix step-over-syscall.exp failure Luis Machado
2020-01-21 11:32 ` Alan Hayward
2020-01-21 13:30 ` Luis Machado
2020-01-21 11:24 ` Alan Hayward [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E71BB843-CD38-42E1-988F-9BCC0976B341@arm.com \
--to=alan.hayward@arm.com \
--cc=gdb-patches@sourceware.org \
--cc=luis.machado@linaro.org \
--cc=nd@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox