summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2023-05-02 12:56:32 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-05-15 18:02:20 -0400
commitc343112fb6cb937fdf5a3a279e5fc1cf41bd1b8f (patch)
tree30d8aa6f111fe8cce2bc282f80b470563d95ca26
parent18ea2295f3f1496981ace990ec8e6f7ba844e666 (diff)
downloadhaskell-c343112fb6cb937fdf5a3a279e5fc1cf41bd1b8f.tar.gz
rts: Don't force debug output to stderr
Previously `+RTS -Dw -l` would emit debug output to the eventlog while `+RTS -l -Dw` would emit it to stderr. This was because the parser for `-D` would unconditionally override the debug output target. Now we instead only do so if no it is currently `TRACE_NONE`.
-rw-r--r--rts/RtsFlags.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index 5f1e8d6403..be87917737 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -2201,13 +2201,14 @@ static void read_debug_flags(const char* arg)
}
// -Dx also turns on -v. Use -l to direct trace
// events to the .eventlog file instead.
- RtsFlags.TraceFlags.tracing = TRACE_STDERR;
-
- // sanity implies zero_on_gc
- if(RtsFlags.DebugFlags.sanity){
- RtsFlags.DebugFlags.zero_on_gc = true;
- }
+ if (RtsFlags.TraceFlags.tracing == TRACE_NONE) {
+ RtsFlags.TraceFlags.tracing = TRACE_STDERR;
+ }
+ // sanity implies zero_on_gc
+ if(RtsFlags.DebugFlags.sanity){
+ RtsFlags.DebugFlags.zero_on_gc = true;
+ }
}
#endif