On Sep 21, 2011, at 9:43 AM, Jens Alfke wrote:

>> Is there a secret to getting symbolic breakpoints to work?
>> Set symbolic breakpoint 'keyDown:' (without the quotes) and nothing happens.
> 
> The name has to be like “-[MyView keyDown:]”, otherwise it’s ambiguous which 
> -keyDown: method you mean — there are dozens of implementations of that in 
> classes in AppKit and your app.
> 
> If you’re trying to set a breakpoint on any keyDown: call to any class, you 
> can’t do that. Breakpoints are on code, not selectors.

That works! So apparently the entire symbol including square brackets and the 
initial plus or minus indicating instance method versus class method is 
required for an Objective-C symbolic breakpoint.

The Xcode 4 User Guide explicitly states

You can specify the symbol as:

     A method name. For example, pathsMatchingExtensions:.

     A method of a particular class. For example, [SKTLine drawHandlesInView], 
people::Person::name().

     A function name. For example, _objc_msgForward.


So the documentation is apparently wrong or Xcode 4.1 has not caught up to the 
documentation. After testing various symbols this is what I found.

LLDB
     keyDown:              NOTHING
     [MyView keyDown:]     NOTHING
     -[MyView keyDown:]    WORKS

GDB
     keyDown:              CRASH
     [MyView keyDown:]     WORKS
     -[MyView keyDown:]    WORKS

--Richard

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to