There is no real equivalent. Xcode uses GDB under the hood, so you're basically dealing with that. You could, however, implement it yourself. The code sample below will produce output to standard out only when the debugger is present. You could further protect this by wrapping it in preprocessor directives as a macro and compile it out (or into an inline nil function) if NDEBUG is present at compile time. Any output produced by an application will be directed to the debugging console in Xcode.
extern "C" {
bool IsDebuggerPresent() {
int mib[4];
struct kinfo_proc info;
size_t size;
info.kp_proc.p_flag = 0;
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PID;
mib[3] = getpid();
size = sizeof(info);
sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0);
return ((info.kp_proc.p_flag & P_TRACED) != 0);
}
void OutputDebugString(const char *restrict fmt, ...) {
if( !IsDebuggerPresent() )
return;
va_list args;
va_start(args, fmt);
vprintf(fmt, args);
va_end(args);
}
}