Skip to content
Open
Show file tree
Hide file tree
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 @@ -17,9 +17,9 @@ internal sealed class HangDumpCommandLineProvider : ICommandLineOptionsProvider
public const string HangDumpTypeOptionName = "hangdump-type";

#if NETCOREAPP
private static readonly string[] HangDumpTypeOptions = ["Mini", "Heap", "Full", "Triage"];
private static readonly string[] HangDumpTypeOptions = ["Mini", "Heap", "Full", "Triage", "None"];
#else
private static readonly string[] HangDumpTypeOptions = ["Mini", "Heap", "Full"];
private static readonly string[] HangDumpTypeOptions = ["Mini", "Heap", "Full", "None"];
#endif

private static readonly IReadOnlyCollection<CommandLineOption> CachedCommandLineOptions =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,13 @@ private async Task TakeDumpAsync(IProcess process, CancellationToken cancellatio

#if NETCOREAPP
DiagnosticsClient diagnosticsClient = new(process.Id);
DumpType dumpType = _dumpType.ToLowerInvariant().Trim() switch
DumpType? dumpType = _dumpType.ToLowerInvariant().Trim() switch
{
"mini" => DumpType.Normal,
"heap" => DumpType.WithHeap,
"triage" => DumpType.Triage,
"full" => DumpType.Full,
"none" => null,
_ => throw ApplicationStateGuard.Unreachable(),
};

Expand All @@ -372,7 +373,12 @@ private async Task TakeDumpAsync(IProcess process, CancellationToken cancellatio

try
{
diagnosticsClient.WriteDump(dumpType, finalDumpFileName, logDumpGeneration: false);
// Skip creating the dump if the option is set to none, and just kill the process.
if (dumpType.HasValue)
{
diagnosticsClient.WriteDump(dumpType.Value, finalDumpFileName, logDumpGeneration: false);
_dumpFiles.Add(finalDumpFileName);
}
}
catch (Exception e)
{
Expand All @@ -381,26 +387,30 @@ private async Task TakeDumpAsync(IProcess process, CancellationToken cancellatio
}

#else
MiniDumpWriteDump.MiniDumpTypeOption miniDumpTypeOption = _dumpType.ToLowerInvariant().Trim() switch
MiniDumpWriteDump.MiniDumpTypeOption? miniDumpTypeOption = _dumpType.ToLowerInvariant().Trim() switch
{
"mini" => MiniDumpWriteDump.MiniDumpTypeOption.Mini,
"heap" => MiniDumpWriteDump.MiniDumpTypeOption.Heap,
"full" => MiniDumpWriteDump.MiniDumpTypeOption.Full,
"none" => null,
_ => throw ApplicationStateGuard.Unreachable(),
};

try
{
MiniDumpWriteDump.CollectDumpUsingMiniDumpWriteDump(process.Id, finalDumpFileName, miniDumpTypeOption);
// Skip creating the dump if the option is set to none, and just kill the process.
if (miniDumpTypeOption.HasValue)
{
MiniDumpWriteDump.CollectDumpUsingMiniDumpWriteDump(process.Id, finalDumpFileName, miniDumpTypeOption.Value);
_dumpFiles.Add(finalDumpFileName);
}
}
catch (Exception e)
{
await _logger.LogErrorAsync($"Error while writing dump of process {process.Name} {process.Id}", e).ConfigureAwait(false);
await _outputDisplay.DisplayAsync(new ErrorMessageOutputDeviceData(string.Format(CultureInfo.InvariantCulture, ExtensionResources.ErrorWhileDumpingProcess, process.Id, process.Name, e)), cancellationToken).ConfigureAwait(false);
}
#endif

_dumpFiles.Add(finalDumpFileName);
}

private static void NotifyCrashDumpServiceIfEnabled()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -188,12 +188,12 @@ The timeout value is specified in one of the following formats:
</data>
<data name="HangDumpTypeOptionDescription" xml:space="preserve">
<value>Specify the type of the dump.
Valid values are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) or 'Full'.
Valid values are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) or 'Full'.
Default type is 'Full'</value>
</data>
<data name="HangDumpTypeOptionInvalidType" xml:space="preserve">
<value>'{0}' is not a valid dump type.
Valid options are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) and 'Full'</value>
Valid options are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) and 'Full'</value>
</data>
<data name="HangDumpUnsupportedRequestTypeErrorMessage" xml:space="preserve">
<value>Request of type '{0}' is not supported</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ Hodnota časového limitu se zadává v jednom z následujících formátů:
</trans-unit>
<trans-unit id="HangDumpTypeOptionDescription">
<source>Specify the type of the dump.
Valid values are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) or 'Full'.
Valid values are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) or 'Full'.
Default type is 'Full'</source>
<target state="translated">Určete typ výpisu paměti.
<target state="needs-review-translation">Určete typ výpisu paměti.
Platné hodnoty jsou Mini, Heap, Triage (dostupné pouze v .NET 6+) nebo Full.
Výchozí typ je Full.</target>
<note />
</trans-unit>
<trans-unit id="HangDumpTypeOptionInvalidType">
<source>'{0}' is not a valid dump type.
Valid options are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) and 'Full'</source>
<target state="translated">{0} není platný typ výpisu paměti.
Valid options are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) and 'Full'</source>
<target state="needs-review-translation">{0} není platný typ výpisu paměti.
Platné možnosti jsou Mini, Heap, Triage (k dispozici pouze v .NET 6+) a Full.</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ Der Timeoutwert wird in einem der folgenden Formate angegeben:
</trans-unit>
<trans-unit id="HangDumpTypeOptionDescription">
<source>Specify the type of the dump.
Valid values are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) or 'Full'.
Valid values are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) or 'Full'.
Default type is 'Full'</source>
<target state="translated">Geben Sie den Typ des Speicherabbilds an.
<target state="needs-review-translation">Geben Sie den Typ des Speicherabbilds an.
Gültige Werte sind "Mini", "Heap", "Triage" (nur in .NET 6 und höher verfügbar) oder "Full".
Der Standardtyp ist "Full".</target>
<note />
</trans-unit>
<trans-unit id="HangDumpTypeOptionInvalidType">
<source>'{0}' is not a valid dump type.
Valid options are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) and 'Full'</source>
<target state="translated">"{0}" ist kein gültiger Speicherabbildtyp.
Valid options are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) and 'Full'</source>
<target state="needs-review-translation">"{0}" ist kein gültiger Speicherabbildtyp.
Gültige Optionen sind "Mini", "Heap", "Triage" (nur in .NET 6 und höher verfügbar) und "Full".</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ El valor de tiempo de espera se especifica en uno de los formatos siguientes:
</trans-unit>
<trans-unit id="HangDumpTypeOptionDescription">
<source>Specify the type of the dump.
Valid values are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) or 'Full'.
Valid values are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) or 'Full'.
Default type is 'Full'</source>
<target state="translated">Especifique el tipo de volcado.
<target state="needs-review-translation">Especifique el tipo de volcado.
Los valores válidos son 'Mini', 'Heap', 'Triage' (solo disponible en .NET 6+) o 'Full'.
El tipo predeterminado es 'Full'</target>
<note />
</trans-unit>
<trans-unit id="HangDumpTypeOptionInvalidType">
<source>'{0}' is not a valid dump type.
Valid options are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) and 'Full'</source>
<target state="translated">'{0}' no es un tipo de volcado válido.
Valid options are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) and 'Full'</source>
<target state="needs-review-translation">'{0}' no es un tipo de volcado válido.
Las opciones válidas son 'Mini', 'Heap', 'Triage' (solo disponible en .NET 6+) y 'Full'</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ La valeur du délai d'expiration est spécifiée dans l'un des formats suivants
</trans-unit>
<trans-unit id="HangDumpTypeOptionDescription">
<source>Specify the type of the dump.
Valid values are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) or 'Full'.
Valid values are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) or 'Full'.
Default type is 'Full'</source>
<target state="translated">Spécifiez le type de vidage.
<target state="needs-review-translation">Spécifiez le type de vidage.
Les valeurs valides sont « Mini », « Heap », « Triage » (uniquement disponible dans .NET 6+) ou « Full ».
Le type par défaut est « Complet »</target>
<note />
</trans-unit>
<trans-unit id="HangDumpTypeOptionInvalidType">
<source>'{0}' is not a valid dump type.
Valid options are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) and 'Full'</source>
<target state="translated">'{0}' n'est pas un type de vidage valide.
Valid options are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) and 'Full'</source>
<target state="needs-review-translation">'{0}' n'est pas un type de vidage valide.
Les options valides sont « Mini », « Heap », « Triage » (uniquement disponible dans .NET 6+) et « Full »</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ Il valore del timeout è specificato in uno dei formati seguenti:
</trans-unit>
<trans-unit id="HangDumpTypeOptionDescription">
<source>Specify the type of the dump.
Valid values are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) or 'Full'.
Valid values are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) or 'Full'.
Default type is 'Full'</source>
<target state="translated">Specificare il tipo di dump.
<target state="needs-review-translation">Specificare il tipo di dump.
I valori validi sono 'Mini', 'Heap', 'Triage' (disponibile solo in .NET 6+) o 'Full'.
Il tipo predefinito è 'Full'</target>
<note />
</trans-unit>
<trans-unit id="HangDumpTypeOptionInvalidType">
<source>'{0}' is not a valid dump type.
Valid options are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) and 'Full'</source>
<target state="translated">'{0}' non è un tipo di dump valido.
Valid options are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) and 'Full'</source>
<target state="needs-review-translation">'{0}' non è un tipo di dump valido.
Le opzioni valide sono 'Mini', 'Heap', 'Triage' (disponibile solo in .NET 6+) e 'Full'</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ The timeout value is specified in one of the following formats:
</trans-unit>
<trans-unit id="HangDumpTypeOptionDescription">
<source>Specify the type of the dump.
Valid values are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) or 'Full'.
Valid values are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) or 'Full'.
Default type is 'Full'</source>
<target state="translated">ダンプの型を指定します。
<target state="needs-review-translation">ダンプの型を指定します。
有効な値は、'Mini'、'Heap'、'Triage' (.NET 6 以降でのみ利用可能)、または 'Full' です。
既定の型は 'Full' です</target>
<note />
</trans-unit>
<trans-unit id="HangDumpTypeOptionInvalidType">
<source>'{0}' is not a valid dump type.
Valid options are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) and 'Full'</source>
<target state="translated">'{0}' は有効なダンプの種類ではありません。
Valid options are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) and 'Full'</source>
<target state="needs-review-translation">'{0}' は有効なダンプの種類ではありません。
有効なオプションは、'Mini'、'Heap'、'Triage' (.NET 6 以降でのみ利用可能)、'Full' です</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ The timeout value is specified in one of the following formats:
</trans-unit>
<trans-unit id="HangDumpTypeOptionDescription">
<source>Specify the type of the dump.
Valid values are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) or 'Full'.
Valid values are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) or 'Full'.
Default type is 'Full'</source>
<target state="translated">덤프의 유형을 지정합니다.
<target state="needs-review-translation">덤프의 유형을 지정합니다.
유효한 값은 'Mini', 'Heap', 'Triage'(.NET 6+에서만 사용 가능) 또는 'Full'입니다.
기본 유형은 'Full'입니다.</target>
<note />
</trans-unit>
<trans-unit id="HangDumpTypeOptionInvalidType">
<source>'{0}' is not a valid dump type.
Valid options are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) and 'Full'</source>
<target state="translated">'{0}'은(는) 올바른 덤프 유형이 아닙니다.
Valid options are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) and 'Full'</source>
<target state="needs-review-translation">'{0}'은(는) 올바른 덤프 유형이 아닙니다.
유효한 옵션은 'Mini', 'Heap', 'Triage'(.NET 6 이상에서만 사용 가능) 및 'Full'입니다.</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ Wartość limitu czasu jest określana w jednym z następujących formatów:
</trans-unit>
<trans-unit id="HangDumpTypeOptionDescription">
<source>Specify the type of the dump.
Valid values are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) or 'Full'.
Valid values are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) or 'Full'.
Default type is 'Full'</source>
<target state="translated">Określ typ zrzutu.
<target state="needs-review-translation">Określ typ zrzutu.
Prawidłowe wartości to „Mini”, „Sterta”, „Klasyfikacja” (dostępne tylko na platformie .NET 6+) lub „Pełne”.
Domyślny typ to „Pełne”</target>
<note />
</trans-unit>
<trans-unit id="HangDumpTypeOptionInvalidType">
<source>'{0}' is not a valid dump type.
Valid options are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) and 'Full'</source>
<target state="translated">„{0}” nie jest prawidłowym typem zrzutu.
Valid options are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) and 'Full'</source>
<target state="needs-review-translation">„{0}” nie jest prawidłowym typem zrzutu.
Prawidłowe opcje to „Mini”, „Sterta", "Klasyfikacja" (dostępne tylko na platformie .NET 6+) i „Pełne”</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ O valor de tempo limite é especificado em um dos seguintes formatos:
</trans-unit>
<trans-unit id="HangDumpTypeOptionDescription">
<source>Specify the type of the dump.
Valid values are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) or 'Full'.
Valid values are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) or 'Full'.
Default type is 'Full'</source>
<target state="translated">Especifique o tipo do despejo.
<target state="needs-review-translation">Especifique o tipo do despejo.
Os valores válidos são "Mini", "Heap", "Triage" (disponível somente no .NET 6+) ou "Full".
O tipo padrão é ''Full''</target>
<note />
</trans-unit>
<trans-unit id="HangDumpTypeOptionInvalidType">
<source>'{0}' is not a valid dump type.
Valid options are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) and 'Full'</source>
<target state="translated">"{0}" não é um tipo de despejo válido.
Valid options are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) and 'Full'</source>
<target state="needs-review-translation">"{0}" não é um tipo de despejo válido.
As opções válidas são ''Mini'', ''Heap'', ''Triage'' (disponível somente no .NET 6+) e ''Full''</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ The timeout value is specified in one of the following formats:
</trans-unit>
<trans-unit id="HangDumpTypeOptionDescription">
<source>Specify the type of the dump.
Valid values are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) or 'Full'.
Valid values are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) or 'Full'.
Default type is 'Full'</source>
<target state="translated">Укажите тип дампа.
<target state="needs-review-translation">Укажите тип дампа.
Допустимые значения: "Mini", "Heap", "Triage" (доступно только в .NET 6+) или "Full".
Тип по умолчанию — "Full"</target>
<note />
</trans-unit>
<trans-unit id="HangDumpTypeOptionInvalidType">
<source>'{0}' is not a valid dump type.
Valid options are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) and 'Full'</source>
<target state="translated">"{0}" не является допустимым типом дампа.
Valid options are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) and 'Full'</source>
<target state="needs-review-translation">"{0}" не является допустимым типом дампа.
Допустимые параметры: "Mini", "Heap", "Triage" (доступно только в .NET 6+) и "Full"</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ Zaman aşımı değeri, aşağıdaki biçimlerden biri ile belirtilir:
</trans-unit>
<trans-unit id="HangDumpTypeOptionDescription">
<source>Specify the type of the dump.
Valid values are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) or 'Full'.
Valid values are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) or 'Full'.
Default type is 'Full'</source>
<target state="translated">Dökümün türünü belirtin.
<target state="needs-review-translation">Dökümün türünü belirtin.
Geçerli değerler 'Mini', 'Heap', 'Triage' (yalnızca .NET 6+'da mevcuttur) veya 'Full'dür.
Varsayılan tür 'Full'dür</target>
<note />
</trans-unit>
<trans-unit id="HangDumpTypeOptionInvalidType">
<source>'{0}' is not a valid dump type.
Valid options are 'Mini', 'Heap', 'Triage' (only available in .NET 6+) and 'Full'</source>
<target state="translated">'{0}' geçerli bir döküm türü değil.
Valid options are 'Mini', 'Heap', 'Triage', 'None' (only available in .NET 6+) and 'Full'</source>
<target state="needs-review-translation">'{0}' geçerli bir döküm türü değil.
Geçerli seçenekler 'Mini', 'Heap', 'Triage' (yalnızca .NET 6+'da mevcuttur) ve 'Full’dür</target>
<note />
</trans-unit>
Expand Down
Loading
Loading