This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Fix mi-break.exp: 'b "basics.c":16'
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Michael Elizabeth Chastain <mec at shout dot net>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 3 Apr 2002 11:20:15 -0500
- Subject: Re: [RFA] Fix mi-break.exp: 'b "basics.c":16'
- References: <200204031558.g33FwO705749@duracef.shout.net>
On Wed, Apr 03, 2002 at 09:58:24AM -0600, Michael Elizabeth Chastain wrote:
> I have a question about this linespec patch.
>
> After I apply the patch, decode_line_1 looks like this:
>
> /* Extract the file name. */
> p1 = p;
> while (p != *argptr && p[-1] == ' ')
> --p;
> if ((*p == '"') && is_quote_enclosed)
> --p;
> copy = (char *) alloca (p - *argptr + 1);
> memcpy (copy, *argptr, p - *argptr);
> /* It may have the ending quote right after the file name */
> if (is_quote_enclosed && copy[p - *argptr - 1] == '"')
> copy[p - *argptr - 1] = 0;
> else
> copy[p - *argptr] = 0;
>
> If there is a '"' at the end, then it won't be copied into "copy".
> So these lines look redundant to me:
>
> if (is_quote_enclosed && copy[p - *argptr - 1] == '"')
> copy[p - *argptr - 1] = 0;
>
> Or maybe I am missing something, such as nested quotes?
The two lines:
if ((*p == '"') && is_quote_enclosed)
--p;
I left because they were there, and I don't understand every situation
that can reach this code. But for "basics.c":16, *p == ':'. So the
quote is actually copied.
>
> Michael C
>
> 2002-04-02 Daniel Jacobowitz <drow@mvista.com>
>
> * linespec.c (decode_line_1): Check for a double quote after
> a filename correctly.
>
>
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer