From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22755 invoked by alias); 1 Oct 2013 18:05:40 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 22727 invoked by uid 48); 1 Oct 2013 18:05:39 -0000 From: "palves at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/15990] New: linespecs of the form *EXPR fail when EXPR contains a path with a ':' Date: Tue, 01 Oct 2013 18:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: palves at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-q4/txt/msg00004.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=15990 Bug ID: 15990 Summary: linespecs of the form *EXPR fail when EXPR contains a path with a ':' Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: palves at redhat dot com I tried this in the dw2-dos-drive.exp test: -gdb_test "break 'z:file.c':func" {Breakpoint [0-9]+ at .*} +gdb_test "break *'z:file.c'::func" {Breakpoint [0-9]+ at .*} But, that didn't work: (gdb) break *'z:file.c'::func Unmatched single quote. The issue is that the tokenizer returns "*'z" as first token instead of the whole linespec, which is what you'd get without the colon. (top-gdb) p token $1 = {type = LSTOKEN_STRING, data = {string = {ptr = 0x1f3a166 "*'z:file.c'::func", length = 3}, keyword = 0x1f3a166 "*'z:file.c'::func"}} Then this: /* Get the first token. */ token = linespec_lexer_lex_one (parser); /* It must be either LSTOKEN_STRING or LSTOKEN_NUMBER. */ if (token.type == LSTOKEN_STRING && *LS_TOKEN_STOKEN (token).ptr == '*') { char *expr; const char *copy; /* User specified an expression, *EXPR. Ignore the token's length, we want to parse everything beyond the '*'. */ copy = expr = xstrdup (LS_TOKEN_STOKEN (token).ptr); cleanup = make_cleanup (xfree, expr); PARSER_RESULT (parser)->expr_pc = linespec_expression_to_pc (©); parses just a chunk of the expression it should parse. Everything after the '*' is an expression (the syntax is *EXPR), so I think it's wrong to even try to tokenize anything within EXPR to begin with. IMO, we could either handle *EXPR before lexing, or add a LSTOKEN_STAR, but then we'd also need something like a struct ls_parser->want_start, as we only want LSTOKEN_STAR the first time we lex. There's also the parser->is_quote_enclosed business. IOW: (gdb) break "*'z:file.c'::func" Which probably means we need to strip the last double-quote before calling into the expression machinery. -- You are receiving this mail because: You are on the CC list for the bug.