Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ static async Task KillTreeAsyncInternal (int pid, ILog log, bool? diagnostics =

foreach (var diagnose_pid in pids) {
var template = Path.GetTempFileName ();
var templateQuit = Path.GetTempFileName ();
try {
var commands = new StringBuilder ();
using (var dbg = new Process ()) {
Expand All @@ -259,15 +260,17 @@ static async Task KillTreeAsyncInternal (int pid, ILog log, bool? diagnostics =
commands.AppendLine ("detach");
commands.AppendLine ("quit");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that quit still needed ?

@rolfbjarne rolfbjarne Jul 17, 2020

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not, but I wondered if earlier versions of lldb (on older macOS versions) would still support multiple --source arguments, so I left it there. I figured that leaving it would be the safest option.

dbg.StartInfo.FileName = "/usr/bin/lldb";
dbg.StartInfo.Arguments = StringUtils.FormatArguments ("--source", template);
dbg.StartInfo.Arguments = StringUtils.FormatArguments ("--source", template, "--source", templateQuit);
File.WriteAllText (template, commands.ToString ());
File.WriteAllText (templateQuit, "quit\n");

log.WriteLine ($"Printing backtrace for pid={pid}");
await RunAsyncInternal (dbg, log, log, log, TimeSpan.FromSeconds (30), diagnostics: false);
}
} finally {
try {
File.Delete (template);
File.Delete (templateQuit);
} catch {
// Don't care
}
Expand Down