This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [RFA2] Follow-up decode_line_1 crash



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.


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