• 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: No Breakpoints on Unused Variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: No Breakpoints on Unused Variables
      • From: Andreas Grosam <email@hidden>
References: 
 >No Breakpoints on Unused Variables (From: Gordon Apple <email@hidden>)

  • Prev by Date: Re: Xcode-users Digest, Vol 8, Issue 300
  • Next by Date: Symlinked source file "cannot be saved. The file does not exist."
  • Previous by thread: Re: No Breakpoints on Unused Variables
  • Next by thread: Re: No Breakpoints on Unused Variables
  • Index(es):
    • Date
    • Thread