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: [RFA] cleanup: while (isspace) -> skip_spaces{,_const}


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


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