From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27119 invoked by alias); 1 May 2005 20:54:33 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 27098 invoked from network); 1 May 2005 20:54:26 -0000 Received: from unknown (HELO mout0.freenet.de) (194.97.50.131) by sourceware.org with SMTP; 1 May 2005 20:54:26 -0000 Received: from [194.97.55.148] (helo=mx5.freenet.de) by mout0.freenet.de with esmtpa (Exim 4.51) id 1DSLSF-00011l-T1; Sun, 01 May 2005 22:54:19 +0200 Received: from a3efe.a.pppool.de ([213.6.62.254]) by mx5.freenet.de with esmtpsa (ID balagi@justmail.de) (TLSv1:RC4-SHA:128) (Exim 4.51 #8) id 1DSLSE-0003Rx-Oc; Sun, 01 May 2005 22:54:19 +0200 Date: Sun, 01 May 2005 20:54:00 -0000 To: "Daniel Jacobowitz" Subject: Re: gdb 6.3 C++ breakpoint in constructor/destructor patch Cc: gdb-patches@sources.redhat.com References: <20050501190532.GB9429@nevyn.them.org> From: "Thomas Maier" Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: In-Reply-To: <20050501190532.GB9429@nevyn.them.org> User-Agent: Opera M2/7.54 (Win32, build 3929) X-SW-Source: 2005-05/txt/msg00022.txt.bz2 Hello, On Sun, 1 May 2005 15:05:32 -0400, Daniel Jacobowitz wrote: > On Sun, May 01, 2005 at 08:32:12PM +0200, Thomas Maier wrote: >> Hello, >> >> I want to supply a patch for the released gdb 6.3, that fixes partially >> the gdb bugs >> >> gdb/1091: Constructor breakpoints ignored >> gdb/1193: g++ 3.3 creates multiple constructors: gdb 5.3 can't set >> breakpoints >> >> I was really confused, why my programs to not stop at the breakpoint in >> constructor/destructors. Now i know, it is not the fault of my programs >> ;) >> Since this anoying problem seems to be in gdb since the gcc 3.x >> release, i >> guess, no one else a) has this problem (i don't believe so) or b) will >> not >> fix it. So i did it ;) >> >> This modification is only made for commands like "break >> [source]:". For C++ constructors and destructors, the patch >> creates more than one breakpoint at the source at lineno, but each >> generated breakpoint will have another address! >> >> NOTE: this is only a simple "hack". I have spent only one day to get >> into >> gdb source code and do the modification. >> It would be better, to create only one breakpoint in such >> C++ constructors >> and destructors and assign multiple addresses to it. But this needs a >> huge >> modification of gdb, i guess ;) > > This is not a very useful change, because it only handles the case > where everything at a particular line is in the same symtab. Often > this will not be the case. Ok, hmm, then the code in find_line_symtab() must not return one symtab, which is used to find one or more references to the lineno, it must return a list of symtabs with references to this lineno. Means, a similar search over all symtabs which is already done in find_line_symtab(). Would that be enough to handle the file:lineno case? (If yes it think a new function like find_multi_line_symtab() is the best way to do it, then in decode_all_digits() fill in the sals with the found symtabs + linenos) > If you take a look at the archives for the list, you will find a lot of > discussion on this subject - as well as a prototype patch I posted > earlier this year. That patch may be good enough for your needs, since > it handles the file:lineno case. But it isn't done yet, and I haven't > had time to go back to it yet. > Intresting... -Thomas Maier