mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Implement ? suffix to "quiet" a context and exclude it from backtraces (#1800)
This commit is contained in:
@@ -6,16 +6,24 @@
|
||||
|
||||
#include "platform.hpp" // strcasecmp
|
||||
|
||||
uint64_t traceDepth = 0;
|
||||
Tracing tracing;
|
||||
|
||||
bool trace_ParseTraceDepth(char const *arg) {
|
||||
if (!strcasecmp(arg, "collapse")) {
|
||||
traceDepth = TRACE_COLLAPSE;
|
||||
tracing.collapse = true;
|
||||
return true;
|
||||
} else if (!strcasecmp(arg, "no-collapse")) {
|
||||
tracing.collapse = false;
|
||||
return true;
|
||||
} else if (!strcasecmp(arg, "all")) {
|
||||
tracing.loud = true;
|
||||
return true;
|
||||
} else if (!strcasecmp(arg, "no-all")) {
|
||||
tracing.loud = false;
|
||||
return true;
|
||||
} else {
|
||||
char *endptr;
|
||||
tracing.depth = strtoul(arg, &endptr, 0);
|
||||
return arg[0] != '\0' && *endptr == '\0';
|
||||
}
|
||||
|
||||
char *endptr;
|
||||
traceDepth = strtoul(arg, &endptr, 0);
|
||||
|
||||
return arg[0] != '\0' && *endptr == '\0' && traceDepth != TRACE_COLLAPSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user