Re: No Breakpoints on Unused Variables
Re: No Breakpoints on Unused Variables
- Subject: Re: No Breakpoints on Unused Variables
- From: Jeffrey Walton <email@hidden>
- Date: Tue, 09 Aug 2011 18:29:06 -0400
On Tue, Aug 9, 2011 at 2:29 PM, Gordon Apple <email@hidden> wrote:
> Why can I not set a breakpoint on an unused variable expression so I can
> step into it? Is there a setting I need to change? (Diagnostic purpose.)
Assuming you are using GDB: under your debug configuration, set
optimizations to 0 (-O0), and symbols to 3 (-g3). I believe any
optimizations will remove the unused (IIRC, it happens at -O1). -g3
will include maximum symbol information, including symbolic constants.
I don't believe GDB extensions (-ggdb) are required or needed.
For what its worth, I don't believe Xcode sets up a 'debug'
configuration correctly. In addition to the above, -DDEBUG is not
defined. Others can probably list more debug options not present in
the stock Apple configuration. Also be aware of a 'release'
configuration, which lacks -DNDEBUG. Software written against POSIX
might do awful things (like call abort() after an assert) because the
macro was not removed as specified.
Matt Neuburg's book discusses issues similar to these. Of all my books
on iOS and Mac OS X programming, his is the only one which discusses
the topic. Its unfortunate more authors don't take the time to explain
tools to a user.
Jeff
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden