Debug Break Code

Member
Posts: 31
Joined: 2009.01
Post: #1
Hey Everyone,

Does anyone know the break code for the iphone and the iphone simulator? I want the equivelant to _asm int 3;

Please help Smile

Thanks!
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2008.12
Post: #2
I use something like this...

Code:
#if TARGET_IPHONE_SIMULATOR
        #define PRIMITIVE_Break() \
            __asm { int 3 };
    #elif TARGET_OS_IPHONE
        #define PRIMITIVE_Break() \
            asm {trap};
    #endif
Quote this message in a reply
Member
Posts: 257
Joined: 2004.06
Post: #3
Okay, this is something new to me. Why would you want to do this versus using a break point in Xcode?

The brains and fingers behind Malarkey Software (plus caretaker of the world's two brattiest felines).
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2008.12
Post: #4
As far as I know (and this is how I am using it), these "DebugBreak" instructions are mostly used in assert macros. Whenever one of you assertions fails, you application will break in the debugger (whatever the project you are working on vs. one project per breakpoint).
Quote this message in a reply
Member
Posts: 31
Joined: 2009.01
Post: #5
Awesome thanks Ozirus!

That worked. And to answer Malarkey's question it's for my custom assert class.

If you don't use assert you should, when something bad happens you get to find out about it without incurring the overhead for release builds.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Changing Configuration from "Debug" to "Release" causes Graphics Bugs Bersaelor 6 4,104 Jun 28, 2010 06:30 AM
Last Post: Skorche
  adhoc different then device debug? kendric 8 4,866 Jan 15, 2010 11:42 AM
Last Post: kendric
  app crashes in non-debug environment Gillissie 2 2,984 Dec 12, 2009 05:03 PM
Last Post: DoG
  #define DEBUG, RELEASE haudio 8 7,115 Feb 5, 2009 12:50 AM
Last Post: kalimba