This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Fix for mishandling of "break 'pthread_create@GLIBC_2.2.5'"
- From: Daniel Jacobowitz <drow at false dot org>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: gdb-patches at sourceware dot org, Doug Evans <dje at google dot com>, Michael Snyder <msnyder at specifix dot com>
- Date: Thu, 5 Jun 2008 22:34:29 -0400
- Subject: Re: [RFC] Fix for mishandling of "break 'pthread_create@GLIBC_2.2.5'"
- References: <8ac60eac0805131135h5e9dd46ev8b7f39e660bf0bb7@mail.gmail.com> <20080513184447.GA12349@caradoc.them.org> <8ac60eac0805131351s241d33a8pd7d9839c51e53a8d@mail.gmail.com> <20080513205941.GA21147@caradoc.them.org> <8ac60eac0805131411q443b8f3awa464e090a5a44aaf@mail.gmail.com> <8ac60eac0805131805m6216660ej7b8e859ce46cb084@mail.gmail.com> <20080605191340.GB25085@caradoc.them.org> <8ac60eac0806051914w6f5ddc6ex3f9a74c9fee198c8@mail.gmail.com>
On Thu, Jun 05, 2008 at 07:14:25PM -0700, Paul Pluzhnikov wrote:
> > If I'm right, that implies that this breaks:
> >
> > (gdb) break 'foo.c':13
>
> But that is *already* broken:
>
> (gdb) b t.c:8
> Breakpoint 1 at 0x400308: file t.c, line 8.
> (gdb) b "t.c":8
> Breakpoint 2 at 0x400308: file t.c, line 8.
> (gdb) b 't.c':8
> No source file named t.c'.
> (gdb)
Hmm, how peculiar.
> I can fix that (and I believe it should be fixed), but it appears
> that single and double quotes are treated quite differently in
> linespec.c
>
> Is there maybe a reason for this?
Hysterical raisins? This code has a long and messy history. If you
think it's bad now, you should go find a version before David
Carlton's heroic untangling of it.
> > We need to call locate_first_half to separate the filename from the
> > line number. There's also the 'foo.c'::staticvar form to worry about.
>
> That case already works correctly (remember -- variables go through
> totally different path).
So I suppose break 'foo.c'::staticfunc is broken too.
> +
> + if (p[0] == '\'')
> + {
> + char *q = p + 1;
> + for (; *q && q[0] != '\''; q++) { }
> + if (q[0] == '\'')
> + q++;
> + else
> + error (_("missing closing quote in command"));
> + p = q;
> + }
> for (; *p; p++)
> {
> if (p[0] == '<')
>
Except, do we really want to keep searching past the single quote?
(I'm not saying you're wrong... too tired to straighten this out
conclusively tonight.)
--
Daniel Jacobowitz
CodeSourcery