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
19 changes: 15 additions & 4 deletions src/Microsoft.Diagnostics.ExtensionCommands/DumpAsyncCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,24 @@ public sealed class DumpAsyncCommand : ExtensionCommandBase
[ServiceImport(Optional = true)]
public ClrRuntime? Runtime { get; set; }


/// <summary>Gets whether to only show stacks that include the object with the specified address.</summary>
[Option(Name = "--address", Aliases = new string[] { "-addr" }, Help = "Only show stacks that include the object with the specified address.")]
public ulong? ObjectAddress { get; set; }
public string? ObjectAddress
{
get => _objectAddress?.ToString();
set => _objectAddress = ParseAddress(value);
}
private ulong? _objectAddress;

/// <summary>Gets whether to only show stacks that include objects with the specified method table.</summary>
[Option(Name = "--methodtable", Aliases = new string[] { "-mt" }, Help = "Only show stacks that include objects with the specified method table.")]
public ulong? MethodTableAddress { get; set; }
public string? MethodTableAddress
{
get => _methodTableAddress?.ToString();
set => _methodTableAddress = ParseAddress(value);
}
private ulong? _methodTableAddress;

/// <summary>Gets whether to only show stacks that include objects whose type includes the specified name in its name.</summary>
[Option(Name = "--type", Help = "Only show stacks that include objects whose type includes the specified name in its name.")]
Expand Down Expand Up @@ -532,14 +543,14 @@ string Describe(ClrObject obj)
// <summary>Determines whether the specified object is of interest to the user based on their criteria provided as command arguments.</summary>
bool IncludeInOutput(ClrObject obj)
{
if (ObjectAddress is ulong addr && obj.Address != addr)
if (_objectAddress is ulong addr && obj.Address != addr)
{
return false;
}

if (obj.Type is not null)
{
if (MethodTableAddress is ulong mt && obj.Type.MethodTable != mt)
if (_methodTableAddress is ulong mt && obj.Type.MethodTable != mt)
{
return false;
}
Expand Down