On Wednesday 04 Jan 2006 1:10 am, Daniel Jacobowitz wrote: > On Tue, Jan 03, 2006 at 06:35:45PM +0530, Amit Kale wrote: > > Hi All, > > > > I've rebased the breakpoints in constructors patch to current cvs. It's > > attached for reviews and a submission into mainline gdb after any > > modifications/improvements as per gdb gurus' suggestions. > > > > I ran gdb testsuite with this patch and found several failures which were > > absent in a cvs-built gdb. They are mainly related to "advance" command. > > I am looking at the failures and trying to fix them. I'll send an update > > if I can fix any of them. > > > > I'll very much appreciate any feedback for this. > > Hi Amit, and sorry for not getting back to you about this last time you > posted it on gdb@. > > The short version is that I believe this is roughly the right approach, > but not quite. I posted a work-in-progress patch some time ago that > takes a slightly different approach: > > Date: Sun, 13 Mar 2005 19:38:24 -0500 > From: Daniel Jacobowitz > Subject: RFC: First stab at breakpoints in multiple locations > > You might want to take a look at that thread, if you haven't already, > to see what I mean. The basic difference is that instead of "break > Foo::Foo" setting multiple breakpoints, it would set only one > breakpoint, but that breakpoint would be associated with multiple PC > values. It's a large patch, though I like your approach. Multiple breakpoints appearing when only one was specified might confuse a user. > > I can't really tell from your patch what cases you do handle or don't; > do breakpoints on constructors by name work? How about by line number? It handles breakpoints specified by line numbers. It doesn't work for constructors by name (e.g. MyClass::MyClass). The original patch I had written for gdb-5.3.* worked for names also. Seems like some part of the rebase went wrong. I'll look into that. gdb testsuite showed several failures. One of them was "advance" command didn't work. I fixed that. I have attached the same patch with this fix in it. I was not able to fix other failures though. The major one being a breakpoint on a statement in main causes three breakpoints to appear. It's because this statement is a call to a C++ inlined function. The expansion of inline function dodges the check in my patch for multiple breakpoints appearing for the same C statement when the statement is spread across multiple instructions interlaced with instructions from surrounding statements. I checked for function name, which would be the inline function name. That's why my check fails. Sigh, I wanted to send this patch again only after fixing this problem, but don't have any good ideas on how to do that. I'll very much appreciate if anyone has ideas about fixing this. Thanks. -Amit