From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23001 invoked by alias); 22 Sep 2009 09:47:25 -0000 Received: (qmail 22990 invoked by uid 22791); 22 Sep 2009 09:47:24 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_44,J_CHICKENPOX_93 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Sep 2009 09:47:18 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id A0E9F290043; Tue, 22 Sep 2009 11:47:15 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rb4qlMPgphgS; Tue, 22 Sep 2009 11:47:15 +0200 (CEST) Received: from province.act-europe.fr (province.act-europe.fr [10.10.0.214]) by mel.act-europe.fr (Postfix) with ESMTP id D3F6F290017; Tue, 22 Sep 2009 11:47:14 +0200 (CEST) Received: by province.act-europe.fr (Postfix, from userid 560) id CAA06164C42; Tue, 22 Sep 2009 11:47:14 +0200 (CEST) Date: Tue, 22 Sep 2009 09:47:00 -0000 From: Jerome Guitton To: Joel Brobecker Cc: Vladimir Prus , gdb@sources.redhat.com Subject: Re: Symbols/blocks questions Message-ID: <20090922094714.GA54075@adacore.com> References: <200909191552.02677.ghost@cs.msu.su> <20090919163344.GL7961@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090919163344.GL7961@adacore.com> User-Agent: Mutt/1.5.17 (2007-11-01) Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00284.txt.bz2 Joel Brobecker (brobecker@adacore.com): > Jerome Guitton had a serious look at how things are done when > decoding breakpoint locations, mostly because we wanted Ada and C++ > to use the same code for multiple-location breakpoints. I'll ask him > to see there is any useful piece of information that might help answer > these questions. Not much to add to what Matt already said; and my knowledge in this area have seriously decreased. I will tell you what I *think* I know. IIRC, if decode_line_1 returned more than one line, multiple breakpoints would be created (not a multiple-location breakpoint). Precisely what happens for overloaded functions: multiple breakpoints are created. See test ovldbreak.exp. IIUC, multiple-location breakpoints are only used when the same "location expression" (addr_string) has to be used to identify a set of breakpoints; so that, at breakpoint re-set, the same addr_string can be used to re-create the whole set of sub-breakpoints. So, I *assume* that if decode_line_1 returns more than one location, each of these locations has to refer to a different source location; they should not have the same addr_string. If the same addr_string was used for such breakpoints, the breakpoint reset would call decode_line_1 for each of them, find several instances for each of them, and create duplicates. Let me give an example from my experience of the problem. In AdaCore's debugger, we have a feature that allows the user to select a few choices from the list of all locations that corresponds to a FILE:LINE expression. Say, if the user set a breakpoint in a generic, the debugger asks him on which instances breakpoints should be created, and this user can select several choices in the list. Now, to avoid having the re-set problem, the debugger has to rewrite the addr_string to a sort of "canonical" location. If multiple locations are found for FILE:LINE, say, in Func1 and Func2, then two breakpoints are set in Func1:FILE:LINE and Func2:FILE:LINE. That's the kind of things that you have to do when decode_line_1 returns more than 1 location...