debug_fuzzer change

I don't always want to abort() on an impossible() when debug_fuzzing,
especially if the first impossible() encountered isn't related to the
bug I'm in the midst of trying to hunt down.

I often have breakpoints on impossible() anyway, and I'd like a simple
way to avoid the panic() call during a lengthy debug session.

Make iflags.debug_fuzzer an xint8 instead of a boolean.
Call abort() only if iflags.debug_fuzzer is set to 1.

That allows setting iflags.debug_fuzzer to 2 in order to bypass the
abort call, and make use of other breakpoints that have been set
to narrow down a particular issue.
This commit is contained in:
nhmall
2024-09-09 17:26:53 -04:00
parent 6f64ed90ed
commit d852d54e4c
2 changed files with 3 additions and 2 deletions

View File

@@ -587,7 +587,8 @@ impossible(const char *s, ...)
va_end(the_args);
pbuf[BUFSZ - 1] = '\0'; /* sanity */
paniclog("impossible", pbuf);
if (iflags.debug_fuzzer)
if (iflags.debug_fuzzer
&& iflags.debug_fuzzer == 1)
panic("%s", pbuf);
gp.pline_flags = URGENT_MESSAGE;