This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 7.4->7.5 Regression gdb.base/pending.exp with gdbserver [Re: [PATCH] Dynamic printf for a target agent]


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 (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]