From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17378 invoked by alias); 14 Oct 2008 20:31:34 -0000 Received: (qmail 17370 invoked by uid 22791); 14 Oct 2008 20:31:33 -0000 X-Spam-Check-By: sourceware.org Received: from eu1sys200aog017.obsmtp.com (HELO eu1sys200aog017.obsmtp.com) (207.126.144.131) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 14 Oct 2008 20:30:47 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob017.postini.com ([207.126.147.11]) with SMTP; Tue, 14 Oct 2008 20:30:43 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 93295DA74 for ; Tue, 14 Oct 2008 20:30:43 +0000 (GMT) Received: from mail1.bri.st.com (unknown [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 560824C57B for ; Tue, 14 Oct 2008 20:30:43 +0000 (GMT) Received: from [164.129.14.85] (bri1017.bri.st.com [164.129.14.85]) by mail1.bri.st.com (MOS 3.8.7a) with ESMTP id CKQ31488 (AUTH antony); Tue, 14 Oct 2008 21:30:42 +0100 (BST) Message-ID: <48F50172.40502@st.com> Date: Tue, 14 Oct 2008 20:31:00 -0000 From: Antony KING User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: gdb@sourceware.org Subject: Re: Strange effect in GDB 6.8 when setting breakpoint on symbol with both strong and weak definitions References: <48F49D68.2030701@st.com> <20081014133113.GA11370@caradoc.them.org> In-Reply-To: <20081014133113.GA11370@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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: 2008-10/txt/msg00062.txt.bz2 Daniel Jacobowitz wrote: > On Tue, Oct 14, 2008 at 02:23:52PM +0100, Antony KING wrote: >> As you can see the location of the breakpoint at f() has been shifted >> from its definition in b.c (which is what I expected) before the program >> is run, to its definition in a.c after the program stopped in main() >> (which is not what I would expect). This shift of location seems wrong >> to me and quite unexpected. Is this a bug ? > > I don't know why this happens. I have also just tried this with the CVS HEAD of GDB with the same result. Could it be that GDB is re-evaluating the breakpoint after the program is launched (since it is a pending breakpoint) and a different instance of f() being found ? BTW when I use our build of GDB 6.8 for use with remote SH-4 targets I do not see this "shift" of breakpoint location. Anyway, I think I will submit this behaviour as a bug. >> Another problem is that although there are 2 definitions of f() in the >> program, only 1 breakpoint is being set. My understanding is that GDB >> should set multiple breakpoints on f(). Is this correct (or is this only >> a feature that is enabled when debugging C++ applications) ? > > It would be nice if this worked, but it doesn't; so far it's only > based on line number. So it works for inlined or templated code. OK. I do not remember seeing anything recently on the GDB list about this, but is this an area being looked at as a future enhancement ?