Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Sven Schnelle <svens@stackframe.org>, gdb-patches@sourceware.org
Cc: Helge Deller <deller@gmx.de>,
	John David Anglin <dave.anglin@bell.net>,
	binutils@sourceware.org
Subject: Re: [PATCH v3] gdb/hppa: guess g packet size
Date: Mon, 10 Nov 2025 16:29:33 -0500	[thread overview]
Message-ID: <d9e159b9-53eb-4f89-9a3b-f7865ba35b03@simark.ca> (raw)
In-Reply-To: <20251110210717.152087-1-svens@stackframe.org>

> @@ -2991,15 +3014,32 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
>      = gdbarch_alloc (&info, gdbarch_tdep_up (new hppa_gdbarch_tdep));
>    hppa_gdbarch_tdep *tdep = gdbarch_tdep<hppa_gdbarch_tdep> (gdbarch);
> 
> -  /* Determine from the bfd_arch_info structure if we are dealing with
> -     a 32 or 64 bits architecture.  If the bfd_arch_info is not available,
> -     then default to a 32bit machine.  */
> -  if (info.bfd_arch_info != NULL)
> -    tdep->bytes_per_address =
> -      info.bfd_arch_info->bits_per_address / info.bfd_arch_info->bits_per_byte;
> +  /* Determine from the target description if we are dealing with
> +     a 32 or 64 bits architecture. If the target description is not
> +     available, then check whether bfd_arch_info could be used.
> +     Otherwise default to a 32bit machine.
> +  */
> +  if (info.target_desc != nullptr)
> +    {
> +      if (tdesc_property (info.target_desc, PROPERTY_GP64) != nullptr)
> +	tdep->bytes_per_address = 8;
> +      else if (tdesc_property (info.target_desc, PROPERTY_GP32) != nullptr)
> +	tdep->bytes_per_address = 4;
> +      else
> +	{
> +	  warning (_("target returned a target description this gdb doesn't "
> +		     "support for the HP/PA architecture"));

Good idea to put out a warning.  I would suggesting some minor changes
to the message:

	  warning (_("The target returned a target description but this gdb "
		     "doesn't support target descriptions for the HP/PA
		     "architecture"));

Just thinking out loud: it would actually be nice to have this warning
for all architectures that don't support target descriptions, if there
was a way to put it at a single common place.

Other than that, the patch looks fine.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Do you have push access or would you like me to push the patch on your
behalf (with the modification proposed above)?

Simon

  reply	other threads:[~2025-11-10 21:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10 21:07 Sven Schnelle
2025-11-10 21:29 ` Simon Marchi [this message]
2025-11-10 21:34   ` Sven Schnelle
2025-11-10 21:38     ` Simon Marchi
2025-11-10 21:39       ` Sven Schnelle
2025-11-10 22:51         ` Simon Marchi

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=d9e159b9-53eb-4f89-9a3b-f7865ba35b03@simark.ca \
    --to=simark@simark.ca \
    --cc=binutils@sourceware.org \
    --cc=dave.anglin@bell.net \
    --cc=deller@gmx.de \
    --cc=gdb-patches@sourceware.org \
    --cc=svens@stackframe.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