Breaking into the debugger on iPhone

后端 未结 8 1277
花落未央
花落未央 2020-12-15 07:23

For assert macros in my iPhone project, I\'m looking for a way to programmatically break into the debugger. On Windows (MSVC++), I can use __debugbreak() for this purpose. I

8条回答
  •  借酒劲吻你
    2020-12-15 08:03

    edit

    Turns out this also works:

    #define Debugger() { raise( SIGINT ) ; }

    I think it's the same principle.


    I use this:

    #define Debugger() { kill( getpid(), SIGINT ) ; }

    I think it works in the simulator and on the device.. no assembly required!

提交回复
热议问题