Skip to content

Commit

Permalink
[Backtracing] Also update the Linux crash handler, now it's merged.
Browse files Browse the repository at this point in the history
The Linux crash handler should have the same `output-to` behaviour
as on macOS.

rdar://110371557
  • Loading branch information
al45tair committed Jun 7, 2023
1 parent 8b6cfc6 commit 02725d7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions stdlib/public/runtime/CrashHandlerLinux.cpp
Expand Up @@ -617,6 +617,8 @@ const char *backtracer_argv[] = {
"preset", // 26
"--cache", // 27
"true", // 28
"--output-to", // 29
"stdout", // 30
NULL
};

Expand Down Expand Up @@ -769,6 +771,16 @@ run_backtracer(int memserver_fd)
break;
}

switch (_swift_backtraceSettings.outputTo) {
case OutputTo::Stdout:
backtracer_argv[30] = "stdout";
break;
case OutputTo::Auto: // Shouldn't happen, but if it does pick stderr
case OutputTo::Stderr:
backtracer_argv[30] = "stderr";
break;
}

backtracer_argv[28] = trueOrFalse(_swift_backtraceSettings.cache);

format_unsigned(_swift_backtraceSettings.timeout, timeout_buf);
Expand Down

0 comments on commit 02725d7

Please sign in to comment.