• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Breakpoint on arbitrary selector
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Breakpoint on arbitrary selector


  • Subject: Breakpoint on arbitrary selector
  • From: daniel <email@hidden>
  • Date: Wed, 26 Jan 2005 15:04:23 -0800


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:
This email sent to email@hidden


  • Follow-Ups:
    • RE: Breakpoint on arbitrary selector
      • From: "Jonathan E. Jackel" <email@hidden>
  • Prev by Date: Another WebView Printing Question
  • Next by Date: Creating file packages
  • Previous by thread: Re: Another WebView Printing Question
  • Next by thread: RE: Breakpoint on arbitrary selector
  • Index(es):
    • Date
    • Thread