From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11192 invoked by alias); 6 Jun 2008 02:14:59 -0000 Received: (qmail 11178 invoked by uid 22791); 6 Jun 2008 02:14:58 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 06 Jun 2008 02:14:35 +0000 Received: from zps19.corp.google.com (zps19.corp.google.com [172.25.146.19]) by smtp-out.google.com with ESMTP id m562ETew017635 for ; Fri, 6 Jun 2008 03:14:30 +0100 Received: from yw-out-2324.google.com (ywh5.prod.google.com [10.192.8.5]) by zps19.corp.google.com with ESMTP id m562ESlr014360 for ; Thu, 5 Jun 2008 19:14:29 -0700 Received: by yw-out-2324.google.com with SMTP id 5so449958ywh.27 for ; Thu, 05 Jun 2008 19:14:28 -0700 (PDT) Received: by 10.150.49.1 with SMTP id w1mr2759847ybw.24.1212718468424; Thu, 05 Jun 2008 19:14:28 -0700 (PDT) Received: by 10.151.109.14 with HTTP; Thu, 5 Jun 2008 19:14:25 -0700 (PDT) Message-ID: <8ac60eac0806051914w6f5ddc6ex3f9a74c9fee198c8@mail.gmail.com> Date: Fri, 06 Jun 2008 02:14:00 -0000 From: "Paul Pluzhnikov" To: "Paul Pluzhnikov" , gdb-patches@sourceware.org, "Doug Evans" , "Michael Snyder" Subject: Re: [RFC] Fix for mishandling of "break 'pthread_create@GLIBC_2.2.5'" In-Reply-To: <20080605191340.GB25085@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00093.txt.bz2 On Thu, Jun 5, 2008 at 12:13 PM, Daniel Jacobowitz wrote: > On Tue, May 13, 2008 at 06:05:05PM -0700, Paul Pluzhnikov wrote: >> So the expression evaluation and the breakpoint evaluation go >> completely separate routes: > > Ah, right. I tried nested functions in GCC, which have the same > problem. Yes, and the same fix should fix that as well :) >> set_flags (*argptr, &is_quoted, &paren_pointer); >> >> - /* Check to see if it's a multipart linespec (with colons or >> - periods). */ >> + if ((*argptr)[0] == '\'') > > I believe this is the same as is_quoted. You are correct. > 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) 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? > 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). > I think locate_first_half is going to have to know whether is_quoted, > and if so, only look for the matching quote. Something like this: @@ -1003,7 +1003,9 @@ locate_first_half (char **argptr, int *i /* Maybe arg is FILE : LINENUM or FILE : FUNCTION. May also be CLASS::MEMBER, or NAMESPACE::NAME. Look for ':', but ignore - inside of <>. */ + inside of <>. + May also be 'FILE' : LINENUM, or 'symbol@VERSION'. Ignore + any ':' or '.' inside single qoutes. */ p = *argptr; if (p[0] == '"') @@ -1014,6 +1016,17 @@ locate_first_half (char **argptr, int *i } else *is_quote_enclosed = 0; + + 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] == '<') -- Paul Pluzhnikov