DebugPrint to debugger util function
This commit is contained in:
@@ -25,6 +25,8 @@ bool IsDebuggerAttached();
|
|||||||
// If no debugger is present, a signal will be raised.
|
// If no debugger is present, a signal will be raised.
|
||||||
void Break();
|
void Break();
|
||||||
|
|
||||||
|
void DebugPrint(const char *fmt, ...);
|
||||||
|
|
||||||
} // namespace debugging
|
} // namespace debugging
|
||||||
} // namespace xe
|
} // namespace xe
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "xenia/base/debugging.h"
|
#include "xenia/base/debugging.h"
|
||||||
|
#include "xenia/base/string_buffer.h"
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
@@ -18,5 +19,16 @@ bool IsDebuggerAttached() { return IsDebuggerPresent() ? true : false; }
|
|||||||
|
|
||||||
void Break() { __debugbreak(); }
|
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 debugging
|
||||||
} // namespace xe
|
} // namespace xe
|
||||||
|
|||||||
Reference in New Issue
Block a user