• 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
Re: Setting conditional breakpoint on Cocoa method?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting conditional breakpoint on Cocoa method?


  • Subject: Re: Setting conditional breakpoint on Cocoa method?
  • From: Graham Cox <email@hidden>
  • Date: Mon, 28 Jul 2008 22:30:09 +1000

Ah thanks, that's very helpful.

One thing that I'm a bit unsure about. If I enter a symbolic breakpoint, will it break on the first instruction of that method or further along? It matters because that doc states:

"If you've stopped at the first instruction of a routine, the first parameter is at 4 bytes above the stack pointer, the second parameter is 8 bytes above the stack pointer, and so on. The GDB syntax is *(int *)($esp+4), *(int *)($esp+8), and so on.

If you've stopped elsewhere in the routine (after the frame has been created), the first parameter is at 8 bytes above the frame pointer, the second parameter is 12 bytes above the frame pointer, and so on. The GDB syntax is *(int *)($ebp+8), *(int *)($ebp+12), and so on."

Assuming the first case, wouldn't the offset be 12, not 16? (two implied parameters then the first visible one). The second case would be 16 of course - so I need to know where a symbolic breakpoint actually stops.



cheers, Graham





On 28 Jul 2008, at 6:47 pm, Jonathan del Strother wrote:


On Mon, Jul 28, 2008 at 8:02 AM, Graham Cox <email@hidden> wrote:
Once in a blue moon, I get a console message that a nil string was passed to
[NSConcreteAttributedString initWithString:] I'd like to find out where this
is coming from by setting a breakpoint there, but only for a nil string.
Adding the breakpoint as a symbol to the symbolic breakpoints works, but I
can't set the condition (e.g. aString == nil), since the parameter's name
isn't available.


What can I do, since this method is called hundreds of times in the normal
course of things, so just having an unconditional breakpoint isn't very
useful. Can I specify a register somehow?



Take a look at the debugging magic page - http://developer.apple.com/technotes/tn2004/tn2124.html I believe you want *(int*)($ebp+16)

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: Setting conditional breakpoint on Cocoa method?
      • From: Ken Thomases <email@hidden>
References: 
 >Setting conditional breakpoint on Cocoa method? (From: Graham Cox <email@hidden>)
 >Re: Setting conditional breakpoint on Cocoa method? (From: "Jonathan del Strother" <email@hidden>)

  • Prev by Date: Re: How to get the cursor animation effects - Clouds of smoke when deleting something
  • Next by Date: Re: Setting conditional breakpoint on Cocoa method?
  • Previous by thread: Re: Setting conditional breakpoint on Cocoa method?
  • Next by thread: Re: Setting conditional breakpoint on Cocoa method?
  • Index(es):
    • Date
    • Thread