• 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: why are conditional breakpoints SO SLOW?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why are conditional breakpoints SO SLOW?


  • Subject: Re: why are conditional breakpoints SO SLOW?
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 18 Mar 2014 09:27:41 -0700


On Mar 18, 2014, at 8:43 AM, Dallman, John <email@hidden> wrote:

Sadly, that is quite easy. The way conditional breakpoints work is that the breakpoint
instruction is put into the code, and the app starts.

And in general a breakpoint instruction generates a type of CPU trap/exception — the same category as a segfault or divide-by-zero. These are very expensive at the CPU-cycles level, requiring a context switch and saving CPU state to RAM. At that point the debugger has to read the CPU state, figure out what breakpoint the CPU corresponds to, and so forth. Finally on the way back to your code, there’s another context switch.

If you want to make this faster, put the conditional test into your code and set a regular breakpoint on a line that only gets hit if the condition matches.
(Is there a function that will do the equivalent of hitting a breakpoint, i.e. a modern-day equivalent of the old Debugger() call?)

—Jens
 _______________________________________________
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: 
 >why are conditional breakpoints SO SLOW? (From: Roland King <email@hidden>)
 >RE: why are conditional breakpoints SO SLOW? (From: "Dallman, John" <email@hidden>)

  • Prev by Date: Re: Xcode 5.1 compiler option -Ofast
  • Next by Date: Re: why are conditional breakpoints SO SLOW?
  • Previous by thread: RE: why are conditional breakpoints SO SLOW?
  • Next by thread: Re: why are conditional breakpoints SO SLOW?
  • Index(es):
    • Date
    • Thread