30 #include "precompiled.h"
33 #include <sys/types.h>
50 kill(getpid(), SIGTRAP);
53 #define DEBUGGER_WAIT 3
54 #define DEBUGGER_CMD "gdb"
55 #define DEBUGGER_ARG_FORMAT "--pid=%d"
56 #define DEBUGGER_BREAK_AFTER_WAIT 0
64 pid_t orgpid=getpid();
76 perror(
"Debugger launch failed");
82 debug_printf(L
"Sleeping until debugger attaches.\nPlease wait.\n");
87 perror(
"Debugger launch: fork failed");
93 #include <android/log.h>
101 __android_log_print(ANDROID_LOG_WARN,
"pyrogenesis",
"%s", str.c_str());
LIB_API void debug_puts(const wchar_t *text)
[system-dependent] write a string to the debug channel.
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
unsigned sleep(unsigned sec)
std::string utf8_from_wstring(const std::wstring &src, Status *err)
opposite of wstring_from_utf8
LIB_API Status debug_CaptureContext(void *context)
LIB_API int debug_IsPointerBogus(const void *p)
check if a pointer appears to be totally invalid.
i64 Status
Error handling system.
void debug_break()
trigger a breakpoint when reached/"called".
#define DEBUGGER_ARG_FORMAT
void udbg_launch_debugger()
void debug_printf(const wchar_t *fmt,...)
write a formatted string to the debug channel, subject to filtering (see below).