This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] cleanup: while (isspace) -> skip_spaces{,_const}
- From: Pedro Alves <palves at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Thu, 07 Mar 2013 16:39:50 +0000
- Subject: Re: [RFA] cleanup: while (isspace) -> skip_spaces{,_const}
- References: <5137EE7A.9080500@redhat.com>
On 03/07/2013 01:33 AM, Keith Seitz wrote:
> @@ -2185,12 +2186,8 @@ registers_info (char *addr_exp, int fpregs)
> char *start;
> const char *end;
>
> - /* Keep skipping leading white space. */
> - if (isspace ((*addr_exp)))
> - {
> - addr_exp++;
> - continue;
> - }
> + /* Skip leading white space. */
> + addr_exp = skip_spaces (addr_exp);
This now continues forward even if *addr_exp is '\0',
while before the patch it didn't. The code read:
while (*addr_exp != '\0')
{
char *start;
const char *end;
/* Keep skipping leading white space. */
if (isspace ((*addr_exp)))
{
addr_exp++;
continue;
}
/* Discard any leading ``$''. Check that there is something
resembling a register following it. */
if (addr_exp[0] == '$')
addr_exp++;
if (isspace ((*addr_exp)) || (*addr_exp) == '\0')
error (_("Missing register name"));
And it seems to be we'll now reach that last error in that
case, while we wouldn't before. Can we trigger that with
"info register rip ", say?
--
Pedro Alves