Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Cc: Pedro Alves <palves@redhat.com>
Subject: Re: 7.4->7.5 Regression gdb.base/pending.exp with gdbserver  [Re: [PATCH] Dynamic printf for a target agent]
Date: Sat, 28 Jul 2012 10:24:00 -0000	[thread overview]
Message-ID: <3480554.LITosdQYbn@qiyao.dyndns.org> (raw)
In-Reply-To: <5012C373.4050006@redhat.com>

On Friday, July 27, 2012 05:36:03 PM Pedro Alves wrote:
> @@ -2938,14 +2938,12 @@ process_point_options (CORE_ADDR point_addr, char
> **packet) }
>        else
>         {
> -         /* Unrecognized token, just skip it.  */
>           fprintf (stderr, "Unknown token %c, ignoring.\n",
>                    *dataptr);
> +         /* Skip tokens until we find one that we recognize.  */
> +         while (*dataptr && *dataptr != ';')
> +           dataptr++;
>         }
> -
> -      /* Skip tokens until we find one that we recognize.  */
> -      while (*dataptr && *dataptr != 'X' && *dataptr != ';')
> -       dataptr++;
>      }
>    *packet = dataptr;

Pedro,
I like it.  It is better to remove 'X' out of condition checking, so that it 
is easier to add other new tokens in the future.

I am wondering that the original code can skip some "bad" chars in 'X' and 
'cmds:' to go to next ';', and I don't know this case does exist.  We may add 
an assertion at the end of 'while (*dataptr)' loop, like this,

  while (*dataptr)
    {
       ...
       gdb_assert (*dataptr == 0 || *dataptr == ';');
    }

or we don't have to worry about this at all.

-- 
Yao (齐尧)


  reply	other threads:[~2012-07-28 10:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30  1:10 [PATCH] Dynamic printf for a target agent Stan Shebs
2012-05-31  6:02 ` Yao Qi
2012-06-25 15:31   ` Stan Shebs
2012-06-27 20:45     ` Tom Tromey
2012-07-02 18:19       ` Stan Shebs
2012-07-18 19:18         ` 7.4->7.5 Regression gdb.base/pending.exp with gdbserver [Re: [PATCH] Dynamic printf for a target agent] Jan Kratochvil
2012-07-20  2:28           ` Yao Qi
2012-07-25 19:50             ` Jan Kratochvil
2012-07-27  2:32               ` [committed]: " Yao Qi
2012-07-27 16:36             ` Pedro Alves
2012-07-28 10:24               ` Yao Qi [this message]
2012-07-28 11:41                 ` Yao Qi
2012-07-02 16:41     ` Build regression on 64-bit hosts " Jan Kratochvil

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=3480554.LITosdQYbn@qiyao.dyndns.org \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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