Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

nubie - symbolic breakpoints in xcode?

I am trying to learn cocoa and reading Hillegass's book. In the third edition on page 59, he talks about creating symbolic breakpoints by clicking near a line number with no code.
First, how do you get the line numbers in the xcode editor?
And can anyone explain the bit on page 60 regarding symbolic links?
Thanks
Lewis

Quicksilver 867, Pismo 500, G5 dual 2, Macbook C2D, Mac OS X (10.5.3)

Posted on Jul 15, 2008 6:49 PM

Reply
2 replies

Jul 16, 2008 9:09 PM in response to Lewis

HI Lewis--

I think you're getting a couple of things confused.

In the third edition on page 59, he talks about creating symbolic breakpoints by clicking near a line number with no code.


No, on page 58 and 59 (until the last paragraph), he's talking about setting breakpoints in the code editor (i.e., by clicking on a line number). The last paragraph on 59 is when he starts talking about symbolic breakpoints.

First, how do you get the line numbers in the xcode editor?


I'm not sure about Xcode 3, but in Xcode 2, it's in the main Xcode prefs. Look for "Text Editing", then look for "Show line numbers". You might also have to choose "Show gutter" to get the whole gutter area to show up. There's a section in the Xcode user guide that might help you to find it (look for "Displaying the Gutter").

And can anyone explain the bit on page 60 regarding symbolic links?


That's not "symbolic links" but "symbolic breakpoints", which are something completely different. What he's talking about is that you can set the debugger to stop when a particular function gets called (functions are sometimes called "symbols"). In that section, he gives an example of objcexceptionthrow. I think that he picked that because that's what gets called when Objective-C encounters an error.

Another use for this might be if you are linking to another library or framework but you don't have the source code, just the compiled library with debugging symbols built in. You might want to stop when you call a function from your library or framework in order to make sure that it got called with the right parameters. So you'd just set a symbolic breakpoint on a function in your library. When it gets called, you drop into the debugger where you can start poking around. But that's pretty advanced stuff, so don't worry about it.

You could also set set symbolic breakpoints on other kinds of functions. Suppose you want to stop your program every time NSRectFill gets called: just set a symbolic breakpoint on NSRectFill. I can also set it on Objective-C methods, by adding this to the breakpoints:

+[NSCalendarDate calendarDate]


But I can't figure how to get it to stop on, for example, awakeFromNib:. At least, that's how I understand what he's talking about.

charlie

nubie - symbolic breakpoints in xcode?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.