mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 17:28:07 +00:00
remove safe call so crashes in github actions print out callstack
This commit is contained in:
committed by
Ryan Fleury
parent
a6175fecf6
commit
f991a80c85
+4
-22
@@ -158,35 +158,17 @@ t_run_caller(void *raw_ctx)
|
|||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void
|
|
||||||
t_run_fail_handler(void *raw_ctx)
|
|
||||||
{
|
|
||||||
T_RunCtx *ctx = raw_ctx;
|
|
||||||
ctx->result.status = T_RunStatus_Crash;
|
|
||||||
fflush(stdout);
|
|
||||||
fflush(stderr);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal T_RunResult
|
internal T_RunResult
|
||||||
t_run(T_Run run, String8 user_data)
|
t_run(T_Run run, String8 user_data)
|
||||||
{
|
{
|
||||||
T_RunCtx ctx = { .run = run, .user_data = user_data };
|
T_RunCtx ctx = { .run = run, .user_data = user_data, .result.status = T_RunStatus_Fail };
|
||||||
B32 do_safe_call = 1;
|
t_run_caller(&ctx);
|
||||||
#if OS_WINDOWS
|
fflush(stdout);
|
||||||
if (IsDebuggerPresent()) {
|
fflush(stderr);
|
||||||
do_safe_call = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (do_safe_call) {
|
|
||||||
safe_call(t_run_caller, t_run_fail_handler, &ctx);
|
|
||||||
} else {
|
|
||||||
t_run_caller(&ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ctx.result.status == T_RunStatus_Fail || ctx.result.status == T_RunStatus_Crash) {
|
if (ctx.result.status == T_RunStatus_Fail || ctx.result.status == T_RunStatus_Crash) {
|
||||||
fprintf(stderr, "Last captured output:\n%.*s\n", str8_varg(g_output));
|
fprintf(stderr, "Last captured output:\n%.*s\n", str8_varg(g_output));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx.result;
|
return ctx.result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user