public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>,
	Marcus Shawcroft <marcus.shawcroft@arm.com>,
	Yufeng Zhang <Yufeng.Zhang@arm.com>
Subject: Re: [PATCH] Extend handling of immediates on ARM's SystemTap SDT probe support
Date: Sat, 28 Dec 2013 03:41:00 -0000	[thread overview]
Message-ID: <20131228034121.GF4532@adacore.com> (raw)
In-Reply-To: <m3wqivic2t.fsf@redhat.com>

> Continuing my series of fixes on the SystemTap SDT support for the
> ARM/AArch64 architectures, this patch now extends how ARM's SDT specific
> parser handles literal numbers (immediates).
> 
> Currently, it only accepts "#" as the prefix.  However, according to
> "info '(as) ARM-Chars'", expressions can also have "$" and nothing as a
> prefix.  This patch extends the parser to accept those options.
> 
> It is a rather trivial patch, and tests have proved that it works fine.
> OK to apply?
> 
> -- 
> Sergio
> 
> 2013-12-23  Sergio Durigan Junior  <sergiodj@redhat.com>
> 
> 	* arm-linux-tdep.c (arm_stap_is_single_operand): Accept "$" as a
> 	literal prefix.  Also accept no prefix at all.
> 	(arm_stap_parse_special_token): Likewise.
> 	(arm_linux_init_abi): Likewise.

The patch itself looks fine, except for one (correct) bit which caught
my attention. See below.

> 
> diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
> index 0284f69..df2b8c4 100644
> --- a/gdb/arm-linux-tdep.c
> +++ b/gdb/arm-linux-tdep.c
> @@ -1116,7 +1116,7 @@ arm_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
>  static int
>  arm_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
>  {
> -  return (*s == '#' /* Literal number.  */
> +  return (*s == '#' || *s == '$' || isdigit (*s) /* Literal number.  */
>  	  || *s == '[' /* Register indirection or
>  			  displacement.  */
>  	  || isalpha (*s)); /* Register value.  */
> @@ -1183,14 +1183,19 @@ arm_stap_parse_special_token (struct gdbarch *gdbarch,
>  
>        ++tmp;
>        tmp = skip_spaces_const (tmp);
> -      if (*tmp++ != '#')
> -	return 0;
> +      if (*tmp == '#' || *tmp == '$')
> +	++tmp;
>  
>        if (*tmp == '-')
>  	{
>  	  ++tmp;
>  	  got_minus = 1;
>  	}
> +      else if (*tmp == '+')
> +	++tmp;
> +
> +      if (!isdigit (*tmp))
> +	return 0;
>  

I think you mixed in one change which is unrelated to this patch
(the handling of the '+' sign).  Perhaps you had meant to have it
as part of the first patch?

    [PATCH v2] Fix for PR tdep/15653: Implement SystemTap SDT probe
    support for AArch64
    http://www.sourceware.org/ml/gdb-patches/2013-12/msg00887.html

IIRC, this patch was born by extraction out of v1 of the patch above.

If I am correct, this patch is pre-approved with the '+' bit moved to
the correct patch.

Thank you,
-- 
Joel

  parent reply	other threads:[~2013-12-28  3:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-23 19:47 Sergio Durigan Junior
2013-12-24 10:05 ` Marcus Shawcroft
2013-12-24 15:32   ` Sergio Durigan Junior
2013-12-24 17:28     ` Marcus Shawcroft
2013-12-28  3:41 ` Joel Brobecker [this message]
2013-12-28 21:25   ` Sergio Durigan Junior

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=20131228034121.GF4532@adacore.com \
    --to=brobecker@adacore.com \
    --cc=Yufeng.Zhang@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=marcus.shawcroft@arm.com \
    --cc=sergiodj@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).