public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] sim: watch: fix range expression processing
Date: Wed, 13 Jan 2021 10:15:39 +0000	[thread overview]
Message-ID: <20210113101539.GC265215@embecosm.com> (raw)
In-Reply-To: <20210113064022.29521-2-vapier@gentoo.org>

* Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org> [2021-01-13 01:40:22 -0500]:

> The code supports a <start>[,<end>] syntax, but the logic for handling
> the <end> check was broken: it would detect the first byte was ",", but
> then include that in the strtoul call meaning the result is always 0.
> Further, it (re)assigned to arg0 when it meant arg1 which means this
> code always processed a range expression as 0,0.  Oops.
> ---
>  sim/common/ChangeLog   | 4 ++++
>  sim/common/sim-watch.c | 2 +-
>  2 files changed, 5 insertions(+), 1 deletion(-)

Both patches in this series LGTM.

Thanks,
Andrew


> 
> diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
> index 539bab687d46..76d86ea55ef8 100644
> --- a/sim/common/ChangeLog
> +++ b/sim/common/ChangeLog
> @@ -1,3 +1,7 @@
> +2021-01-13  Mike Frysinger  <vapier@gentoo.org>
> +
> +	* sim-watch.c (do_watchpoint_create): Parse arg+1 and assign to arg1.
> +
>  2021-01-13  Mike Frysinger  <vapier@gentoo.org>
>  
>  	* sim-events.c (sim_events_watch_sim): Change byte_order type to
> diff --git a/sim/common/sim-watch.c b/sim/common/sim-watch.c
> index d69d42cb9540..29ac982b0d2a 100644
> --- a/sim/common/sim-watch.c
> +++ b/sim/common/sim-watch.c
> @@ -255,7 +255,7 @@ do_watchpoint_create (SIM_DESC sd,
>  
>    (*point)->arg0 = strtoul (arg, &arg, 0);
>    if (arg[0] == ',')
> -    (*point)->arg0 = strtoul (arg, NULL, 0);
> +    (*point)->arg1 = strtoul (arg + 1, NULL, 0);
>    else
>      (*point)->arg1 = (*point)->arg0;
>  
> -- 
> 2.28.0
> 

      reply	other threads:[~2021-01-13 10:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  6:40 [PATCH 1/2] sim: watch: fix pc watchpoints on little endian host systems Mike Frysinger
2021-01-13  6:40 ` [PATCH 2/2] sim: watch: fix range expression processing Mike Frysinger
2021-01-13 10:15   ` Andrew Burgess [this message]

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=20210113101539.GC265215@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=vapier@gentoo.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).