7.4->7.5 Regression gdb.base/pending.exp with gdbserver [Re: [PATCH] Dynamic printf for a target agent]
Yao Qi
yao@codesourcery.com
Sat Jul 28 10:24:00 GMT 2012
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 (齐尧)
More information about the Gdb-patches
mailing list