Re: Breakpoint on arbitrary selector
Re: Breakpoint on arbitrary selector
- Subject: Re: Breakpoint on arbitrary selector
- From: daniel <email@hidden>
- Date: Thu, 27 Jan 2005 08:38:43 -0800
You must have missed the part in my original message that said I am
working with methods that gdb doesn't recognize (no symbols). That
being the case, Xcode has as much trouble setting the breakpoint as I
do.
My real question is "Why doesn't a conditional breakpoint on
objC_msgSend trap a method call with a particular SEL?" The rest of
the details were for context only. This question is sort of beyond the
scope of Cocoa, I guess. I should probably raise it on the xcode list
if I want gdb nerds to respond :)
Daniel
On Jan 27, 2005, at 8:25 AM, Jonathan E. Jackel wrote:
There is an easy way to do this in the XCode debugger. Bring up the
breakpoints window and create a new breakpoint. Type [BobController
slackOff:]. Jonathan.
-----Original Message-----
From: cocoa-dev-bounces+jonathan=email@hidden
[mailto:cocoa-dev-bounces+jonathan=email@hidden]On
Behalf
Of daniel
Sent: Wednesday, January 26, 2005 6:04 PM
To: Cocoa Dev Dev
Subject: Breakpoint on arbitrary selector
Sometimes when I'm debugging (OK, or hacking) something, a selector
that I know is implemented by one of the classes in the target project
is just not recognized by the debugger. No tab-completion, etc. Even
the class is not recognized. Yet looking up a class object by
NSClassFromString and selector from NSSelectorFromString return
reasonable looking values.
Let's say I know a class "BobController" has a method "slackOff:" - I
get a SEL from NSSelectorFromString(@"slackOff:"). It returns 111300.
I examine memory at that location and sure enough, it looks like a
selector! I set a conditional breakpoint on objC_msgSend, to break
whenever $r4==111300, and run the program.
A very slow launch later, I perform a user action to provoke that
method (in this case, a menu item that InterfaceBuilder shows as being
targeted to "BobController" with an action of "slackOff:"). No
breakpoint!
Is it unrealistic for me to assume that all messages will get sent
through objC_msgSend? What is gdb doing when it sets a breakpoint on
an Objective C method symbol? I guess I could look it up in the
source... any thoughts?
Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden