在iPhone上打入调试器 [英] Breaking into the debugger on iPhone
问题描述
有没有类似于__debugbreak()的苹果手机?我尝试过Debugger(),但是这会给我一个链接器错误。
谢谢,
Claus
编辑
结果也可以:
#define Debugger(){raise(SIGINT);我认为这是一样的原则。
我使用这个:
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. Invoking this function will stop my program, launch the debugger, and display a callstack of the line that called __debugbreak(). Is there anything similar to __debugbreak() for the iPhone? I've tried Debugger(), but that gives me a linker error. Thanks,
Claus edit Turns out this also works: I think it's the same principle. I use this: I think it works
in the simulator and on the device.. no assembly required! 这篇关于在iPhone上打入调试器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! #define Debugger(){kill(getpid(),SIGINT); } $ / $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ b
#define Debugger() { raise( SIGINT ) ; }
#define Debugger() { kill( getpid(), SIGINT ) ; }