public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@arm.com>
To: Dmytro Medvied <dmytro.medvied@gmail.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] aarch64: Fix an infinite loop on bt when the core dump has an SVE section but the target does not support it.
Date: Mon, 27 Mar 2023 10:42:52 +0100	[thread overview]
Message-ID: <dd25dcd3-d42b-969b-832a-c0ec02c5a055@arm.com> (raw)
In-Reply-To: <20230319205529.75469-1-dmytro.medvied@gmail.com>

Hi,

On 3/19/23 20:55, Dmytro Medvied via Gdb-patches wrote:
> When read_aarch64_ctx() returns AARCH64_SVE_MAGIC and the target does not support SVE gdb goes in an infinite loop because the section was not incremented by the size of the read context.
> To fix this behavior, the section needs to be incremented by the size of the read context after the check for target supporting of SVE has returned false.
> ---
>   gdb/aarch64-linux-tdep.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
> index b183a3c9a38..439760fffe2 100644
> --- a/gdb/aarch64-linux-tdep.c
> +++ b/gdb/aarch64-linux-tdep.c
> @@ -337,7 +337,10 @@ aarch64_linux_sigframe_init (const struct tramp_frame *self,
>   	    uint16_t vq;
>   
>   	    if (!tdep->has_sve ())
> -	      break;
> +	      {
> +		section += size;
> +		break;
> +	      }
>   
>   	    if (target_read_memory (section + AARCH64_SVE_CONTEXT_VL_OFFSET,
>   				    buf, 2) != 0)

That's interesting. If the target doesn't support SVE, why is the SVE_MAGIC context being generated in the first place?

It should've been handled by the default case, where we increment the section by the size.

If gdb knows about SVE, it should be able to handle it, unless the target says the vector length is 0.

Could you please clarify what target you observed this on?

  reply	other threads:[~2023-03-27  9:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-19 20:55 Dmytro Medvied
2023-03-27  9:42 ` Luis Machado [this message]
2023-03-29 12:42   ` Дмитро Медвєдь
2023-03-29 13:06     ` Luis Machado
     [not found]       ` <CAJ=kipZRP1QaO-Bp=k+gGONXuAOYnqnVqypLDrVFBbBvnfOApw@mail.gmail.com>
2023-06-08 13:47         ` Luis Machado

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=dd25dcd3-d42b-969b-832a-c0ec02c5a055@arm.com \
    --to=luis.machado@arm.com \
    --cc=dmytro.medvied@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).