Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to list objects that are not in the dominator tree, as they are "leaked" #38

Merged
merged 1 commit into from
Aug 14, 2023
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
9 changes: 8 additions & 1 deletion Commands/ListObjectsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public ListObjectsCommand(Repl repl) : base(repl) { }
[NamedArgument("dominatedby")]
public NativeWord DirectlyDominatedBy;

[FlagArgument("notindom")]
public bool NotInDominatorTree;

[NamedArgument("tagged")]
public string? WithTag;

Expand Down Expand Up @@ -338,6 +341,10 @@ void SelectObjects(TypeSet? typeSet, int domParentPostorderIndex, Selection sele
int domNodeIndex = CurrentHeapDom.GetDominator(CurrentBacktracer.PostorderIndexToNodeIndex(postorderIndex));
selected = domParentPostorderIndex == domNodeIndex;
}
else if (NotInDominatorTree)
{
selected = CurrentHeapDom.GetDominator(CurrentBacktracer.PostorderIndexToNodeIndex(postorderIndex)) == -1;
}

if (selected && WithTag != null)
{
Expand Down Expand Up @@ -369,6 +376,6 @@ bool HasTag(NativeWord address, string selectTag)
return false;
}

public override string HelpText => "listobj ['stats] ['type <type index> ['includederived]] ['owned | 'unowned] ['dominatedby <object address or index or -1 for process>] ['tagged <tag> | 'nottagged <tag>] ['sortbycount | 'sortbysize | 'sortbydomsize]";
public override string HelpText => "listobj ['stats] ['type <type index> ['includederived]] ['owned | 'unowned] ['dominatedby <object address or index or -1 for process>] ['notindom] ['tagged <tag> | 'nottagged <tag>] ['sortbycount | 'sortbysize | 'sortbydomsize]";
}
}