i have a macro for checking and handling 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?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.