Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Alan Hayward <Alan.Hayward@arm.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: nd <nd@arm.com>
Subject: Re: [PATCH 1/2] Add linux_get_hwcap
Date: Mon, 25 Mar 2019 15:18:00 -0000	[thread overview]
Message-ID: <0cea3f8f-e66e-574c-0c6e-aa2c2bbead4f@simark.ca> (raw)
In-Reply-To: <20190325120542.92123-1-alan.hayward@arm.com>

On 2019-03-25 8:05 a.m., Alan Hayward wrote:
> Tidy up calls to read HWCAP (and HWCAP2) by adding common functions,
> removing the PPC and AArch64 specific versions.
> 
> The only function difference is in aarch64_linux_core_read_description - if
> the hwcap read fails it now return a valid description instead of nullptr.

ARM also seems to have changed behavior, both the native target and core 
target.  It's not necessarily, a problem, as long as it's a conscious 
change.

> diff --git a/gdb/linux-tdep.h b/gdb/linux-tdep.h
> index 824ba3afaf..ee9c2bcc90 100644
> --- a/gdb/linux-tdep.h
> +++ b/gdb/linux-tdep.h
> @@ -61,4 +61,10 @@ extern void linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch);
>   
>   extern int linux_is_uclinux (void);
>   
> +/* Fetch the AT_HWCAP entry from the auxv vector for the given TARGET.  */
> +extern CORE_ADDR linux_get_hwcap (struct target_ops *target);
> +
> +/* Fetch the AT_HWCAP2 entry from the auxv vector for the given TARGET.  */
> +extern CORE_ADDR linux_get_hwcap2 (struct target_ops *target);

For these two functions, can you mention that 0 is returned if the 
search in the AUXV vector fails?

I was a bit surprised you didn't keep your version returning a bool to 
indicate whether the search succeeded or failed, but if this version is 
good enough, I am fine with it.  If we ever have a target that really 
needs to differentiate between a lookup failure and a lookup success 
that returns the value 0, we can change it back or add another overload.

This patch LGTM with the comment above updated.

Simon


  parent reply	other threads:[~2019-03-25 15:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25 12:05 Alan Hayward
2019-03-25 12:05 ` [PATCH 2/2] gdbserver: " Alan Hayward
2019-03-25 15:41   ` Simon Marchi
2019-03-26 13:17     ` Alan Hayward
     [not found]       ` <353e83d9-efb3-c485-9ae6-6fc0a1f54553@simark.ca>
     [not found]         ` <57CEBD0C-44A5-48D1-8CEB-54584E1A1A21@arm.com>
     [not found]           ` <59A457A2-F464-4A05-A471-700F066114AD@arm.com>
2019-03-26 14:34             ` FW: " Alan Hayward
2019-03-28  9:50               ` Ulrich Weigand
2019-03-28 11:35                 ` Alan Hayward
2019-03-29 23:12                   ` Ulrich Weigand
2019-04-03 19:13                     ` Pedro Franco de Carvalho
2019-04-04 13:49                       ` Ulrich Weigand
2019-04-05 16:26                         ` Pedro Franco de Carvalho
2019-04-05 16:39                           ` Ulrich Weigand
2019-04-05 17:23                             ` Pedro Franco de Carvalho
2019-04-08  9:38                             ` Alan Hayward
2019-04-11 14:12                               ` Pedro Franco de Carvalho
2019-03-26 14:56             ` FW: " Simon Marchi
2019-04-02 22:00   ` Peter Bergner
2019-04-04 21:22     ` Pedro Franco de Carvalho
2019-03-25 15:18 ` Simon Marchi [this message]
2019-03-25 16:51   ` [PATCH 1/2] " Alan Hayward

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=0cea3f8f-e66e-574c-0c6e-aa2c2bbead4f@simark.ca \
    --to=simark@simark.ca \
    --cc=Alan.Hayward@arm.com \
    --cc=gdb-patches@sourceware.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