• 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? [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting conditional breakpoint on Cocoa method? [SOLVED]


  • Subject: Re: Setting conditional breakpoint on Cocoa method? [SOLVED]
  • From: Graham Cox <email@hidden>
  • Date: Tue, 29 Jul 2008 10:48:48 +1000

Thanks Ken and Jonathan - with your help I got the debugger to reveal the source of the bug and fixed it. (And learned a useful new weapon in the process).

cheers, Graham


On 29 Jul 2008, at 9:38 am, Ken Thomases wrote:

On Jul 28, 2008, at 7:30 AM, Graham Cox wrote:

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?

The breakpoint is after the local frame has been set up:

$ gdb /Applications/TextEdit.app/Contents/MacOS/TextEdit
[...]
(gdb) run
Starting program: /Applications/TextEdit.app/Contents/MacOS/TextEdit
[...]
^C
Program received signal SIGINT, Interrupt.
0x90009cd7 in mach_msg_trap ()
(gdb) break -[NSConcreteAttributedString initWithString:]
Breakpoint 1 at 0x927fb612
(gdb) info break
Num Type Disp Enb Address What
1 breakpoint keep y 0x927fb612 <-[NSConcreteAttributedString initWithString:]+5>


Notice the "+5" in the breakpoint description. If you were to hit that breakpoint and disassemble the current function, you'd see it's past the point where the old frame pointer is pushed and the current stack pointer is copied to be the new frame pointer.

Cheers,
Ken

_______________________________________________

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


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>)
 >Re: Setting conditional breakpoint on Cocoa method? (From: Graham Cox <email@hidden>)
 >Re: Setting conditional breakpoint on Cocoa method? (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: [OT] How do you pronounce .xib?
  • Next by Date: Re: sorting two arrays
  • Previous by thread: Re: Setting conditional breakpoint on Cocoa method?
  • Next by thread: Re: Setting conditional breakpoint on Cocoa method?
  • Index(es):
    • Date
    • Thread