开发者

XCode, place breakpoints by by code

开发者 https://www.devze.com 2023-02-22 12:27 出处:网络
i have a macro for checking and han开发者_运维技巧dling errors #define ERROR_IF_ARG(x, y, z, w)\\

i have a macro for checking and han开发者_运维技巧dling errors

#define ERROR_IF_ARG(x, y, z, w)\
    if (x) {\
        printf("\nERROR! {\n\tText : " y "\n\tExpression : (" #x ")\n\tIn file : %s\n\tLine : %d\n\tFunction : %s\n}\n\n", z, __FILE__, __LINE__, __func__);\
        w;\
    }

in code i call

ERROR_IF_ARG(!isOfType(UNI_STRING), "expected 'std::string', found '%s' ", UNITYPE2STR(type), return NULL);

sadly i cannot place breakpoints inside this macro, but is there maybe some way with using #pragma or __ to place a breakpoint mark by code? or else generate and interuption, so i can trace the problem


Obviously you're running in a debugger if you're looking to use breakpoints; how about using an assert within the macro?

0

精彩评论

暂无评论...
验证码 换一张
取 消