public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@arm.com>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdbserver: fix gdbserver builds after expedite_regs changes
Date: Thu, 5 Oct 2023 12:23:21 +0100	[thread overview]
Message-ID: <c1f48f31-0c0c-0053-27ec-6a9bc40a1d62@arm.com> (raw)
In-Reply-To: <3ae39ff41ea9a6832f24e3fe8425304a25ac671c.1696504740.git.aburgess@redhat.com>

On 10/5/23 12:19, Andrew Burgess wrote:
> After this commit:
> 
>   commit 6a65998a8a94abaaae7ca4ff0ab9c3f25dc2e766
>   Date:   Mon Sep 11 12:42:00 2023 +0100
> 
>       Convert tdesc's expedite_regs to a string vector
> 
> The risc-v, loongarch, and csky gdbserver builds were broken.  A use
> of target_desc::expedite_regs (for each architecture)  was not updated
> to take account of the type change.
> 
> I've tested that this fixes the risc-v build.  I haven't tested the
> other architectures, but they should be fine.
> ---
>  gdbserver/linux-csky-low.cc      | 7 +++++--
>  gdbserver/linux-loongarch-low.cc | 7 +++++--
>  gdbserver/linux-riscv-low.cc     | 8 ++++++--
>  3 files changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/gdbserver/linux-csky-low.cc b/gdbserver/linux-csky-low.cc
> index 3117556f5de..feb428ec9d2 100644
> --- a/gdbserver/linux-csky-low.cc
> +++ b/gdbserver/linux-csky-low.cc
> @@ -132,8 +132,11 @@ csky_target::low_arch_setup ()
>    static const char *expedite_regs[] = { "r14", "pc", NULL };
>    target_desc_up tdesc = csky_create_target_description ();
>  
> -  if (!tdesc->expedite_regs)
> -    init_target_desc (tdesc.get (), expedite_regs);
> +  if (tdesc->expedite_regs.empty ())
> +    {
> +      init_target_desc (tdesc.get (), expedite_regs);
> +      gdb_assert (!tdesc->expedite_regs.empty ());
> +    }
>  
>    current_process ()->tdesc = tdesc.release ();
>  
> diff --git a/gdbserver/linux-loongarch-low.cc b/gdbserver/linux-loongarch-low.cc
> index ead2e76d25d..3eb87f55d0f 100644
> --- a/gdbserver/linux-loongarch-low.cc
> +++ b/gdbserver/linux-loongarch-low.cc
> @@ -84,8 +84,11 @@ loongarch_target::low_arch_setup ()
>    features.xlen = sizeof (elf_greg_t);
>    tdesc = loongarch_create_target_description (features);
>  
> -  if (!tdesc->expedite_regs)
> -    init_target_desc (tdesc.get (), expedite_regs);
> +  if (tdesc->expedite_regs.empty ())
> +    {
> +      init_target_desc (tdesc.get (), expedite_regs);
> +      gdb_assert (!tdesc->expedite_regs.empty ());
> +    }
>    current_process ()->tdesc = tdesc.release ();
>  }
>  
> diff --git a/gdbserver/linux-riscv-low.cc b/gdbserver/linux-riscv-low.cc
> index 129bc3b138b..4c251bb179c 100644
> --- a/gdbserver/linux-riscv-low.cc
> +++ b/gdbserver/linux-riscv-low.cc
> @@ -90,8 +90,12 @@ riscv_target::low_arch_setup ()
>      = riscv_linux_read_features (lwpid_of (current_thread));
>    target_desc_up tdesc = riscv_create_target_description (features);
>  
> -  if (!tdesc->expedite_regs)
> -    init_target_desc (tdesc.get (), expedite_regs);
> +  if (tdesc->expedite_regs.empty ())
> +    {
> +      init_target_desc (tdesc.get (), expedite_regs);
> +      gdb_assert (!tdesc->expedite_regs.empty ());
> +    }
> +
>    current_process ()->tdesc = tdesc.release ();
>  }
>  
> 
> base-commit: 0515a7b643c6f7bbfb647764b702d4c6445618e8

Oops. Sorry about that, and thanks for fixing it. It would be great to have some
speciments of those architectures in the sourceware CI to catch these hiccups.

  reply	other threads:[~2023-10-05 11:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 11:19 Andrew Burgess
2023-10-05 11:23 ` Luis Machado [this message]
2023-10-06 12:20   ` Andrew Burgess

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=c1f48f31-0c0c-0053-27ec-6a9bc40a1d62@arm.com \
    --to=luis.machado@arm.com \
    --cc=aburgess@redhat.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).