in src/Program.cs [174:196]
private static bool DumpProcess(ProcessDumpParameters parameters)
{
try
{
var directory = new FileInfo(parameters.DumpPath).Directory;
if (directory == null) throw new DirectoryNotFoundException($"Parent of {parameters.DumpPath} is null");
if (!directory.Exists)
directory.Create();
var path = parameters.DumpPath;
using (WithTimeoutCookie(parameters.TimeoutMs, () => { }))
{
new DiagnosticsClient(parameters.Pid).WriteDump(DumpType.Full, path);
return true;
}
}
catch (Exception ex)
{
Console.Error.WriteLine($"Cannot dump from process[{parameters.Pid}]. Error: {ex.Message}");
return false;
}
}