[RFA2] Follow-up decode_line_1 crash

Eli Zaretskii eliz@is.elta.co.il
Thu Mar 15 00:52:00 GMT 2001


On Wed, 14 Mar 2001, Keith Seitz wrote:

> *** linespec.c	2000/12/20 14:34:15	2.4
> --- linespec.c	2001/03/14 16:16:11
> *************** decode_line_1 (char **argptr, int funfir
> *** 611,620 ****
>   
>     s = NULL;
>     p = *argptr;
> !   if (p[0] == '"')
>       {
>         is_quote_enclosed = 1;
> !       p++;
>       }
>     else
>       is_quote_enclosed = 0;
> --- 611,620 ----
>   
>     s = NULL;
>     p = *argptr;
> !   if (**argptr == '"')
>       {
>         is_quote_enclosed = 1;
> !       (*argptr)++;
>       }
>     else
>       is_quote_enclosed = 0;

Can the argument have embedded (escaped) quotes, as in "foo\"bar", in
some language?  If it can, the search for the next quote is certainly
not the right thing to do.

One situation where this could happen is when a breakpoint uses the 
file:line notation, since file names could have embedded quotes.



More information about the Gdb-patches mailing list