From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30719 invoked by alias); 10 Jun 2012 19:03:31 -0000 Received: (qmail 30711 invoked by uid 22791); 10 Jun 2012 19:03:30 -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; Sun, 10 Jun 2012 19:03:13 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5AJ3DtG017079 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 10 Jun 2012 15:03:13 -0400 Received: from host2.jankratochvil.net (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5AJ39BC003478 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 10 Jun 2012 15:03:12 -0400 Date: Sun, 10 Jun 2012 19:03:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [patch] Fix "ambiguous linespec" regression: break lineno Message-ID: <20120610190308.GA23551@host2.jankratochvil.net> References: <20120608193958.GA10296@host2.jankratochvil.net> <87ehppczag.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ehppczag.fsf@fleche.redhat.com> 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/msg00265.txt.bz2 On Fri, 08 Jun 2012 22:40:55 +0200, Tom Tromey wrote: > However, why should this apply to linespecs used by 'break' but not by > other ones? + > If we really need two, can we do the processing in linespec.c? Because the values were called default_breakpoint_* before the patch commit eb1a2e1ef3957213a420bbeedff9c045016e3aa0 Author: Justin Lebar skip/blacklist patch renamed default_breakpoint_* into *_last_displayed_ functions. So I find OK to use default_breakpoint_* in breakpoint.c and not to use default_breakpoint_* in other .c files. > Jan> + if (last_displayed_sal_is_valid () > > linespec.c:initialize_defaults has: > > struct symtab_and_line cursal = > get_current_source_symtab_and_line (); > > It seems like we have two similar notions here -- the "current" source > line and the "last displayed" source line. default_breakpoint_* vs. current_source_* locations were always duplicate this way. > This doesn't make sense to me. Can we not just have a single notion and > use it everywhere? I have some draft patch almost without regressions but those two locations had some logic. "break" should put breakpoint to the current frame and not to some last arbitrary line listed. But that seems as definitely a cleanup patch outside of the scope of this one. > I realize you're just reverting a bit of code - but is that ObjC hack > really needed? I'd like us to get away from this kind of thing. It needs to detect the pattern ^[+-] (for 'break +5', 'break -3' etc.) but it should not get confused by the ObjC breakpoints for -[func] or +[func]. I agree if the two locations get unified it is no longer needed. Thanks, Jan