This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: 7.4->7.5 Regression gdb.base/pending.exp with gdbserver [Re: [PATCH] Dynamic printf for a target agent]
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Pedro Alves <palves at redhat dot com>
- Date: Sat, 28 Jul 2012 18:23:41 +0800
- Subject: Re: 7.4->7.5 Regression gdb.base/pending.exp with gdbserver [Re: [PATCH] Dynamic printf for a target agent]
- References: <4FC57340.6070306@earthlink.net> <2625393.59PdMiRRzQ@qiyao.dyndns.org> <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 (éå)