DebugPrint to debugger util function

This commit is contained in:
Dr. Chat 2015-06-06 00:48:28 -05:00
parent 54e8868160
commit 35ad3c0f1f
2 changed files with 14 additions and 0 deletions

View File

@ -25,6 +25,8 @@ bool IsDebuggerAttached();
// If no debugger is present, a signal will be raised.
void Break();
void DebugPrint(const char *fmt, ...);
} // namespace debugging
} // namespace xe

View File

@ -8,6 +8,7 @@
*/
#include "xenia/base/debugging.h"
#include "xenia/base/string_buffer.h"
#include <Windows.h>
@ -18,5 +19,16 @@ bool IsDebuggerAttached() { return IsDebuggerPresent() ? true : false; }
void Break() { __debugbreak(); }
void DebugPrint(const char *fmt, ...) {
StringBuffer buff;
va_list va;
va_start(va, fmt);
buff.AppendVarargs(fmt, va);
va_end(va);
OutputDebugStringA(buff.GetString());
}
} // namespace debugging
} // namespace xe