• 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: breakpoints sometimes stop at the beginning of a C++ method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: breakpoints sometimes stop at the beginning of a C++ method


  • Subject: Re: breakpoints sometimes stop at the beginning of a C++ method
  • From: walterw <email@hidden>
  • Date: Fri, 11 Feb 2005 13:39:22 -0500

Line endings are not the cause for me. All of the code that I'm seeing it in is brand new and not from another platform. My line endings are all LF.

On Feb 11, 2005, at 1:15 PM, Mike Lazear wrote:


On Feb 11, 2005, at 9:51 AM, email@hidden wrote:




Why do breakpoints sometimes stop at the beginning of a C++ method
instead of the line where the breakpoint is set?

Similarly, while stepping through code, the graphical instruction pointer
(not to be confused with the real IP) is often a line or more behind. I
have to rely on watching variables change to red to tell me what line is
really being executed.


I'm using a "development" style build with all optimizations turned off.

Yep, me too. All of the build settings are at the factory default.


We are writing mostly in C and not C++ but we had a similar problem where
the breakpoints didn't line up where they were supposed to. It turned out
for us the problem was line endings. Especially true if the code comes from
another platform. Older Macs used CR for a line ending, PCs use CR LF
and Unix uses LF.


I changed the preference in Xcode to use Unix line endings (Text Editing tab).

I was told at one point that highlighting all code in a file and doing a Re-Indent
would clean this up. It seemed like it helped but it wasn't perfect. We finally got
a copy of BBEdit and created a Text Factory (sounded tough but ended up
being trivial). We ran it against all of our code to change all line endings to
the Unix line ending (LF). Now are breakpoints stop where we expect them
to.


An alternative to using BBEdit is to write a script using Perl or another scripting
language but since I haven't used those before I went with the BBEdit option.


Mike

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden


_______________________________________________ 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
References: 
 >Re: breakpoints sometimes stop at the beginning of a C++ method (From: email@hidden)
 >Re: breakpoints sometimes stop at the beginning of a C++ method (From: Mike Lazear <email@hidden>)

  • Prev by Date: Re: breakpoints sometimes stop at the beginning of a C++ method
  • Next by Date: Re: Problems with assembly "or" instruction...
  • Previous by thread: Re: breakpoints sometimes stop at the beginning of a C++ method
  • Next by thread: Re: breakpoints sometimes stop at the beginning of a C++ method
  • Index(es):
    • Date
    • Thread