From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13656 invoked by alias); 8 Jun 2012 19:40:23 -0000 Received: (qmail 13646 invoked by uid 22791); 8 Jun 2012 19:40:22 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Jun 2012 19:40:02 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q58Je22v011475 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 8 Jun 2012 15:40:02 -0400 Received: from host2.jankratochvil.net (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q58Jdwc9011514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 8 Jun 2012 15:40:01 -0400 Date: Fri, 08 Jun 2012 19:40:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] Fix "ambiguous linespec" regression: break lineno Message-ID: <20120608193958.GA10296@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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: 2012-06/txt/msg00244.txt.bz2 Hi, "list" should set context for the "break barelinenumber" command, this is a usability regression reported by Jakub Jelinek. I have just reverted a part of code removed by the patch: d2fae92c9d78b49086182385a5bbd086b7a030b6 is the first bad commit Author: Tom Tromey the "ambiguous linespec" series It seems somehow clear to me, OK to check it in? tested on {x86_64,x86_64-m32}-fedora18pre-linux-gnu. Thanks, Jan gdb/ 2012-06-08 Jan Kratochvil Fix regression by the "ambiguous linespec" series. * breakpoint.c (parse_breakpoint_sals): New variable cursal. Use get_last_displayed_symtab and get_last_displayed_line and depending on CURSAL. gdb/testsuite/ 2012-06-08 Jan Kratochvil Fix regression by the "ambiguous linespec" series. * gdb.base/break.exp (list marker1, break lineno, delete $bpnum): New tests. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 12db39b..9c4348f 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -8802,19 +8802,26 @@ parse_breakpoint_sals (char **address, } else { + struct symtab_and_line cursal = get_current_source_symtab_and_line (); + /* Force almost all breakpoints to be in terms of the current_source_symtab (which is decode_line_1's default). This should produce the results we want almost all of the - time while leaving default_breakpoint_* alone. */ - if (last_displayed_sal_is_valid ()) + time while leaving default_breakpoint_* alone. + + ObjC: However, don't match an Objective-C method name which + may have a '+' or '-' succeeded by a '['. */ + if (last_displayed_sal_is_valid () + && (!cursal.symtab + || ((strchr ("+-", (*address)[0]) != NULL) + && ((*address)[1] != '[')))) decode_line_full (address, DECODE_LINE_FUNFIRSTLINE, get_last_displayed_symtab (), get_last_displayed_line (), canonical, NULL, NULL); else decode_line_full (address, DECODE_LINE_FUNFIRSTLINE, - (struct symtab *) NULL, 0, - canonical, NULL, NULL); + cursal.symtab, cursal.line, canonical, NULL, NULL); } } diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp index a203364..4254eca 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -371,6 +371,13 @@ gdb_expect { } } +# Test the 'list' commands sets current file for the 'break LINENO' command. +set bp_marker1 [gdb_get_line_number "set breakpoint 16 here" ${srcfile1}] +gdb_test "list marker1" ".*" +gdb_test "break $bp_marker1" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*${srcfile1}, line ${bp_marker1}\\." \ + "break lineno" +gdb_test_no_output {delete $bpnum} + # # run until the breakpoint at a line number #