This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: objc/1430: [RFC]: Disallow ObjC search when resetting breakpoint.


The following reply was made to PR objc/1430; it has been noted by GNATS.

From: Daniel Jacobowitz <drow@mvista.com>
To: fedor@doc.com
Cc: gdb-gnats@sources.redhat.com
Subject: Re: objc/1430: [RFC]: Disallow ObjC search when resetting breakpoint.
Date: Mon, 27 Oct 2003 17:35:32 -0500

 On Mon, Oct 27, 2003 at 07:18:37PM -0000, fedor@doc.com wrote:
 > 
 > >Number:         1430
 > >Category:       objc
 > >Synopsis:       [RFC]: Disallow ObjC search when resetting breakpoint.
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    unassigned
 > >State:          open
 > >Class:          patch
 > >Submitter-Id:   net
 > >Arrival-Date:   Mon Oct 27 19:28:00 UTC 2003
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Adam Fedor
 > >Release:        cvs-2003-10-01
 > >Organization:
 > >Environment:
 > Any Objective-C session
 > >Description:
 > This patch fixes PR objc/1238, where you get frustrating behavior if
 > there is an ObjC method with the same name as a function:
 > 
 > (gdb) break init
 > [0] cancel
 > [1] all
 > [2] -[MyObject init] at gdb-objc-test.m:50
 > [3] -[NewObject init] at gdb-objc-test.m:18
 > [4] init at gdb-objc-test.m:62
 > > 4
 > Breakpoint 1 at 0x10001a40: file gdb-objc-test.m, line 62.
 > (gdb) run
 > Starting program:
 > /home/users/fedor/src/gstep/Tester/shared_debug_obj/gdb-objc-test 
 > [0] cancel
 > [1] all
 > [2] -[MyObject init] at gdb-objc-test.m:50
 > [3] -[NewObject init] at gdb-objc-test.m:18
 > [4] init at gdb-objc-test.m:62
 > > 0
 > Error in re-setting breakpoint 1:
 > canceled
 > [Thread debugging using libthread_db enabled]
 > [New Thread 16384 (LWP 2249)]
 > [0] cancel
 > [1] all
 > [2] -[MyObject init] at gdb-objc-test.m:50
 > [3] -[NewObject init] at gdb-objc-test.m:18
 > [4] init at gdb-objc-test.m:62
 > > 
 > [... on and on ad infinitum ...]
 > 
 > What happens is that every time you try to reset a breakpoint,
 > decode_line_1 gets called and we search through all the ObjC selectors
 > for a match to the breakpoint and there are always multiple matches to
 > "init".
 > 
 > I don't particularly like the solution (It's the way Apple does it,
 > although it might be for more reasons than this, e.g. there's no reason
 > to go through the ObjC selector search when resetting a breakpoint
 > anyway). I can't think of any other way to do it though, unless perhaps
 > there is some way to canonicalize the symbol name for the breakpoint -
 > so it's something like "gdb-objc-test.m:init", and not just "init" -
 > then you won't get multiple matches.
 > 
 > Any comments?
 
 The breakpoint patches I've started working on will need to solve this
 issue in general, not just for ObjC, so I'll need a solution.  I don't
 know quite what to do yet but I think it will involve saving all the
 options, and recording which ones were selected.
 
 -- 
 Daniel Jacobowitz
 MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]