Skip to content

Commit

Permalink
Supposed to be v2 refactoring but no (#7)
Browse files Browse the repository at this point in the history
* v2 migration and a fix for subcommands view (window instead of dialog)
* Small refactoring of views, trying to get custom views up
* fix dcd dcq command names
* brought simple children of CommandViewFactory<TParser> back to single file
* artifacts output
* added dump array
* fixes for filter typing and for buttons container
  • Loading branch information
En3Tho authored Oct 18, 2024
1 parent 8138ba9 commit cda2717
Show file tree
Hide file tree
Showing 65 changed files with 2,289 additions and 2,067 deletions.
13 changes: 10 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
<Project>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>11</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<PropertyGroup>
<CmdletVersion>0.0.8</CmdletVersion>
<CmdletVersion>8.0.0</CmdletVersion>
</PropertyGroup>

<PropertyGroup>
<UseArtifactsOutput>true</UseArtifactsOutput>
<ARTIFACTS_PATH_DOTNET Condition=" '$(ARTIFACTS_PATH_DOTNET)' == '' ">$(MSBuildThisFileDirectory)artifacts</ARTIFACTS_PATH_DOTNET>
<ARTIFACTS_PATH_DOTNET Condition=" '$(ARTIFACTS_PATH_DOTNET)' != '' ">$(ARTIFACTS_PATH_DOTNET)\$(SolutionName)</ARTIFACTS_PATH_DOTNET>
<ArtifactsPath>$(ARTIFACTS_PATH_DOTNET)</ArtifactsPath>
</PropertyGroup>

</Project>
21 changes: 13 additions & 8 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="System.Runtime.Experimental" Version="6.0.2" />
<PackageVersion Include="Terminal.Gui" Version="1.15.1" />
<PackageVersion Include="Microsoft.PowerShell.SDK" Version="7.1.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageVersion Include="xunit" Version="2.4.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageVersion Include="coverlet.collector" Version="3.1.0" />
<PackageVersion Include="Terminal.Gui" Version="1.16.0" />
<PackageVersion Include="Microsoft.PowerShell.SDK" Version="7.4.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="xunit" Version="2.7.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="coverlet.collector" Version="6.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="Microsoft.Build.CopyOnWrite" Version="1.0.282" />
<GlobalPackageReference Include="Microsoft.Build.CopyOnWrite" Version="1.0.330" />
</ItemGroup>
</Project>
43 changes: 23 additions & 20 deletions MakeRelease.ps1
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
$solutionPath = Get-Location

pushd $solutionPath
try
{
$version = "0.0.8"
$modulePath = "$solutionPath\PoshDotnetDumpAnalyzeViewerModule"
$configuration = "Release"
$output = "$solutionPath\Releases\publish"

$version = "0.0.8"
$modulePath = "$solutionPath\PoshDotnetDumpAnalyzeViewerModule"
$configuration = "Release"
$output = "$solutionPath\Releases\publish"

dotnet publish $modulePath -c $configuration -o $output
cd "$solutionPath\Releases"
dotnet publish $modulePath -c $configuration -o $output
cd "$solutionPath\Releases"

Remove-Item $version -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item $version -Force -Recurse -ErrorAction SilentlyContinue

mkdir $version
cd $version
mkdir "PoshDotnetDumpAnalyzeViewerModule"
cd "PoshDotnetDumpAnalyzeViewerModule"
mkdir $version
cd $version
mkdir "PoshDotnetDumpAnalyzeViewerModule"
cd "PoshDotnetDumpAnalyzeViewerModule"

$dllNames =
$dllNames =
"NStack.dll",
"PoshDotnetDumpAnalyzeViewer.dll",
"PoshDotnetDumpAnalyzeViewerModule.dll",
"Terminal.Gui.dll"

foreach ($file in $dllNames) {
Copy-Item "$output\$file" -Destination ".\"
}
foreach ($file in $dllNames) {
Copy-Item "$output\$file" -Destination ".\"
}

Copy-Item "$modulePath\PoshDotnetDumpAnalyzeViewerModule.psd1" -Destination ".\"

popd
Copy-Item "$modulePath\PoshDotnetDumpAnalyzeViewerModule.psd1" -Destination ".\"
}
finally
{
popd
}
4 changes: 3 additions & 1 deletion PoshDotnetAnalyzerViewerTests/ClrStackParsing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using PoshDotnetDumpAnalyzeViewer;
using PoshDotnetDumpAnalyzeViewer.Parsing;
using PoshDotnetDumpAnalyzeViewer.Utilities;
using Xunit;

namespace PoshDotnetAnalyzerViewerTests;
Expand All @@ -22,7 +24,7 @@ public void TestThatClrStackOutputIsParsedCorrectly()
Assert.True(lines is [
not ObjectAddressOutputLine,
not ObjectAddressOutputLine,
ObjectAddressOutputLine { Address.Span: "0x000001c4c14c1600" },
ObjectAddressOutputLine { Address: "0x000001c4c14c1600" },
not ObjectAddressOutputLine,
not ObjectAddressOutputLine,
]);
Expand Down
10 changes: 6 additions & 4 deletions PoshDotnetAnalyzerViewerTests/ClrThreadsParsing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using PoshDotnetDumpAnalyzeViewer;
using PoshDotnetDumpAnalyzeViewer.Parsing;
using PoshDotnetDumpAnalyzeViewer.Utilities;
using Xunit;

namespace PoshDotnetAnalyzerViewerTests;
Expand Down Expand Up @@ -38,10 +40,10 @@ public void TestThatClrThreadsOutputIsParsedCorrectly()
not ClrThreadsOutputLine,
not ClrThreadsOutputLine,
not ClrThreadsOutputLine,
ClrThreadsOutputLine { OsThreadId.Span: "1", ClrThreadId.Span: "1", ThreadState.Span: "2020020" },
ClrThreadsOutputLine { OsThreadId.Span: "10", ClrThreadId.Span: "2", ThreadState.Span: "21220" },
ClrThreadsOutputLine { OsThreadId.Span: "12", ClrThreadId.Span: "4", ThreadState.Span: "21220" },
ClrThreadsOutputLine { OsThreadId.Span: "13", ClrThreadId.Span: "5", ThreadState.Span: "1020220" },
ClrThreadsOutputLine { OsThreadId: "1", ClrThreadId: "1", ThreadState: "2020020" },
ClrThreadsOutputLine { OsThreadId: "10", ClrThreadId: "2", ThreadState: "21220" },
ClrThreadsOutputLine { OsThreadId: "12", ClrThreadId: "4", ThreadState: "21220" },
ClrThreadsOutputLine { OsThreadId: "13", ClrThreadId: "5", ThreadState: "1020220" },
not ClrThreadsOutputLine
]);
}
Expand Down
6 changes: 4 additions & 2 deletions PoshDotnetAnalyzerViewerTests/DumpAssemblyParsing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using PoshDotnetDumpAnalyzeViewer;
using PoshDotnetDumpAnalyzeViewer.Parsing;
using PoshDotnetDumpAnalyzeViewer.Utilities;
using Xunit;

namespace PoshDotnetAnalyzerViewerTests;
Expand All @@ -23,11 +25,11 @@ public void TestThatDumpModuleIsParsedCorrectly()
Assert.True(lines is
[
{},
DomainAddressOutputLine { DomainAddress.Span: "000055a42e3ce3e0" },
DomainAddressOutputLine { DomainAddress: "000055a42e3ce3e0" },
{},
{},
{},
ModuleAddressOutputLine { ModuleAddress.Span: "00007f003dfe4020" },
ModuleAddressOutputLine { ModuleAddress: "00007f003dfe4020" },
]);
}
}
10 changes: 6 additions & 4 deletions PoshDotnetAnalyzerViewerTests/DumpClassParsing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using PoshDotnetDumpAnalyzeViewer;
using PoshDotnetDumpAnalyzeViewer.Parsing;
using PoshDotnetDumpAnalyzeViewer.Utilities;
using Xunit;

namespace PoshDotnetAnalyzerViewerTests;
Expand Down Expand Up @@ -29,12 +31,12 @@ public void TestThatDumpClassIsParsedCorrectly()
Assert.True(lines is
[
{},
TypeNameOutputLine { TypeName.Span: "System.Object[]" },
TypeNameOutputLine { TypeName: "System.Object[]" },
{},
{},
EEClassAddressOutputLine { EEClassAddress.Span: "00007f003ea1d908" },
ModuleAddressOutputLine { ModuleAddress.Span: "00007f003dfe4020" },
MethodTableOutputLine { MethodTable.Span: "00007f003e9f6760" },
EEClassAddressOutputLine { EEClassAddress: "00007f003ea1d908" },
ModuleAddressOutputLine { ModuleAddress: "00007f003dfe4020" },
MethodTableOutputLine { MethodTable: "00007f003e9f6760" },
{},
{},
{},
Expand Down
10 changes: 6 additions & 4 deletions PoshDotnetAnalyzerViewerTests/DumpDomainParsing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using PoshDotnetDumpAnalyzeViewer;
using PoshDotnetDumpAnalyzeViewer.Parsing;
using PoshDotnetDumpAnalyzeViewer.Utilities;
using Xunit;

namespace PoshDotnetAnalyzerViewerTests;
Expand Down Expand Up @@ -41,15 +43,15 @@ public void TestThatDumpDomainIsParsedCorrectly()
{},
{},
{},
AssemblyAddressOutputLine { AssemblyAddress.Span: "000055a42e4d9030" },
AssemblyAddressOutputLine { AssemblyAddress: "000055a42e4d9030" },
{},
{},
ModuleAddressOutputLine { ModuleAddress.Span: "00007f003dfe4020" },
ModuleAddressOutputLine { ModuleAddress: "00007f003dfe4020" },
{},
AssemblyAddressOutputLine { AssemblyAddress.Span: "000055a42e3e3150" },
AssemblyAddressOutputLine { AssemblyAddress: "000055a42e3e3150" },
{},
{},
ModuleAddressOutputLine { ModuleAddress.Span: "00007f003ead44a8" },
ModuleAddressOutputLine { ModuleAddress: "00007f003ead44a8" },
]);
}
}
6 changes: 4 additions & 2 deletions PoshDotnetAnalyzerViewerTests/DumpExceptionsParsing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using PoshDotnetDumpAnalyzeViewer;
using PoshDotnetDumpAnalyzeViewer.Parsing;
using PoshDotnetDumpAnalyzeViewer.Utilities;
using Xunit;

namespace PoshDotnetAnalyzerViewerTests;
Expand Down Expand Up @@ -28,10 +30,10 @@ public void TestThatDumpExceptionsParsingOutputIsParsedCorrectly()
[
not DumpExceptionsOutputLine,
not DumpExceptionsOutputLine,
DumpExceptionsOutputLine { Address.Span: "01e422d00788", MethodTable.Span: "7ff8b7357890", TypeName.Span: "StackExchange.Redis.RedisConnectionException" },
DumpExceptionsOutputLine { Address: "01e422d00788", MethodTable: "7ff8b7357890", TypeName: "StackExchange.Redis.RedisConnectionException" },
not DumpExceptionsOutputLine,
not DumpExceptionsOutputLine,
DumpExceptionsOutputLine { Address.Span: "01e462a93fc8", MethodTable.Span: "7ff90fec88d8", TypeName.Span: "System.Net.Sockets.SocketException" },
DumpExceptionsOutputLine { Address: "01e462a93fc8", MethodTable: "7ff90fec88d8", TypeName: "System.Net.Sockets.SocketException" },
not DumpExceptionsOutputLine,
not DumpExceptionsOutputLine,
not DumpExceptionsOutputLine,
Expand Down
22 changes: 12 additions & 10 deletions PoshDotnetAnalyzerViewerTests/DumpHeapParsing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using PoshDotnetDumpAnalyzeViewer;
using PoshDotnetDumpAnalyzeViewer.Parsing;
using PoshDotnetDumpAnalyzeViewer.Utilities;
using Xunit;

namespace PoshDotnetAnalyzerViewerTests;
Expand Down Expand Up @@ -30,15 +32,15 @@ public void TestThatDumpHeapDefaultOutputIsParsedCorrectly()
[
not (DumpHeapOutputLine or DumpHeapStatisticsOutputLine),
not (DumpHeapOutputLine or DumpHeapStatisticsOutputLine),
DumpHeapOutputLine { Address.Span: "000002a724541000", MethodTable.Span: "000002a722993230" },
DumpHeapOutputLine { Address.Span: "000002a724541018", MethodTable.Span: "000002a722993230" },
DumpHeapOutputLine { Address.Span: "000002a724541030", MethodTable.Span: "000002a722993230" },
DumpHeapOutputLine { Address: "000002a724541000", MethodTable: "000002a722993230" },
DumpHeapOutputLine { Address: "000002a724541018", MethodTable: "000002a722993230" },
DumpHeapOutputLine { Address: "000002a724541030", MethodTable: "000002a722993230" },
not (DumpHeapOutputLine or DumpHeapStatisticsOutputLine),
not (DumpHeapOutputLine or DumpHeapStatisticsOutputLine),
not (DumpHeapOutputLine or DumpHeapStatisticsOutputLine),
DumpHeapStatisticsOutputLine { MethodTable.Span: "00007fff4b774a70", TypeName.Span: "System.IO.SyncTextReader" },
DumpHeapStatisticsOutputLine { MethodTable.Span: "00007fff4b773e68", TypeName.Span: "System.Threading.Tasks.Task+<>c" },
DumpHeapStatisticsOutputLine { MethodTable.Span: "00007fff4b72e0c8", TypeName.Span: "System.IO.Stream+NullStream" },
DumpHeapStatisticsOutputLine { MethodTable: "00007fff4b774a70", TypeName: "System.IO.SyncTextReader" },
DumpHeapStatisticsOutputLine { MethodTable: "00007fff4b773e68", TypeName: "System.Threading.Tasks.Task+<>c" },
DumpHeapStatisticsOutputLine { MethodTable: "00007fff4b72e0c8", TypeName: "System.IO.Stream+NullStream" },
not (DumpHeapOutputLine or DumpHeapStatisticsOutputLine)
]);
}
Expand All @@ -65,10 +67,10 @@ public void TestThatDumpHeapStatOutputIsParsedCorrectly()
{},
{},
{},
DumpHeapStatisticsOutputLine { MethodTable.Span: "00007fff4b774a70", TypeName.Span: "System.IO.SyncTextReader" },
DumpHeapStatisticsOutputLine { MethodTable.Span: "00007fff4b773e68", TypeName.Span: "System.Threading.Tasks.Task+<>c" },
DumpHeapStatisticsOutputLine { MethodTable.Span: "00007fff4b72e0c8", TypeName.Span: "System.IO.Stream+NullStream" },
DumpHeapStatisticsOutputLine { MethodTable.Span: "7fff9b7859c0", TypeName.Span: "System.String" },
DumpHeapStatisticsOutputLine { MethodTable: "00007fff4b774a70", TypeName: "System.IO.SyncTextReader" },
DumpHeapStatisticsOutputLine { MethodTable: "00007fff4b773e68", TypeName: "System.Threading.Tasks.Task+<>c" },
DumpHeapStatisticsOutputLine { MethodTable: "00007fff4b72e0c8", TypeName: "System.IO.Stream+NullStream" },
DumpHeapStatisticsOutputLine { MethodTable: "7fff9b7859c0", TypeName: "System.String" },
{}
]);
}
Expand Down
8 changes: 5 additions & 3 deletions PoshDotnetAnalyzerViewerTests/DumpMethodTableParsing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using PoshDotnetDumpAnalyzeViewer;
using PoshDotnetDumpAnalyzeViewer.Parsing;
using PoshDotnetDumpAnalyzeViewer.Utilities;
using Xunit;

namespace PoshDotnetAnalyzerViewerTests;
Expand Down Expand Up @@ -29,9 +31,9 @@ public void TestThatDumpMethodTableIsParsedCorrectly()
Assert.True(lines is
[
{},
EEClassAddressOutputLine { EEClassAddress.Span: "00007F9F56DFCF48" },
ModuleAddressOutputLine { ModuleAddress.Span: "00007F9F55CB8278" },
TypeNameOutputLine { TypeName.Span: "System.Collections.Immutable.SortedInt32KeyNode`1[[System.Collections.Immutable.ImmutableDictionary`2+HashBucket[[System.String, System.Private.CoreLib],[Microsoft.Build.Execution.ProjectMetadataInstance, Microsoft.Build]], System.Collections.Immutable]]" },
EEClassAddressOutputLine { EEClassAddress: "00007F9F56DFCF48" },
ModuleAddressOutputLine { ModuleAddress: "00007F9F55CB8278" },
TypeNameOutputLine { TypeName: "System.Collections.Immutable.SortedInt32KeyNode`1[[System.Collections.Immutable.ImmutableDictionary`2+HashBucket[[System.String, System.Private.CoreLib],[Microsoft.Build.Execution.ProjectMetadataInstance, Microsoft.Build]], System.Collections.Immutable]]" },
{},
{},
{},
Expand Down
4 changes: 3 additions & 1 deletion PoshDotnetAnalyzerViewerTests/DumpModuleParsing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using PoshDotnetDumpAnalyzeViewer;
using PoshDotnetDumpAnalyzeViewer.Parsing;
using PoshDotnetDumpAnalyzeViewer.Utilities;
using Xunit;

namespace PoshDotnetAnalyzerViewerTests;
Expand Down Expand Up @@ -38,7 +40,7 @@ public void TestThatDumpModuleIsParsedCorrectly()
{},
{},
{},
AssemblyAddressOutputLine { AssemblyAddress.Span: "000055a42e4d9030" },
AssemblyAddressOutputLine { AssemblyAddress: "000055a42e4d9030" },
{},
{},
{},
Expand Down
14 changes: 8 additions & 6 deletions PoshDotnetAnalyzerViewerTests/DumpName2EEParsing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using PoshDotnetDumpAnalyzeViewer;
using PoshDotnetDumpAnalyzeViewer.Parsing;
using PoshDotnetDumpAnalyzeViewer.Utilities;
using Xunit;

namespace PoshDotnetAnalyzerViewerTests;
Expand Down Expand Up @@ -30,17 +32,17 @@ public void TestThatDumpModuleIsParsedCorrectly()
Assert.True(lines is
[
{},
ModuleAddressOutputLine { ModuleAddress.Span: "00007f003dfe4020" },
ModuleAddressOutputLine { ModuleAddress: "00007f003dfe4020" },
not AssemblyAddressOutputLine,
{},
MethodTableOutputLine { MethodTable.Span: "00007f003eab93e0" },
EEClassAddressOutputLine { EEClassAddress.Span: "00007f003eaa3530" },
TypeNameOutputLine { TypeName.Span: "System.Exception" },
MethodTableOutputLine { MethodTable: "00007f003eab93e0" },
EEClassAddressOutputLine { EEClassAddress: "00007f003eaa3530" },
TypeNameOutputLine { TypeName: "System.Exception" },
{},
ModuleAddressOutputLine { ModuleAddress.Span: "00007f003ead44a8" },
ModuleAddressOutputLine { ModuleAddress: "00007f003ead44a8" },
not AssemblyAddressOutputLine,
{},
ModuleAddressOutputLine { ModuleAddress.Span: "00007f003eb46ed8" },
ModuleAddressOutputLine { ModuleAddress: "00007f003eb46ed8" },
not AssemblyAddressOutputLine,
]);
}
Expand Down
22 changes: 12 additions & 10 deletions PoshDotnetAnalyzerViewerTests/DumpObjParsing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using PoshDotnetDumpAnalyzeViewer;
using PoshDotnetDumpAnalyzeViewer.Parsing;
using PoshDotnetDumpAnalyzeViewer.Utilities;
using Xunit;

namespace PoshDotnetAnalyzerViewerTests;
Expand Down Expand Up @@ -33,21 +35,21 @@ public void TestThatDumpObjIsParsedCorrectly()

Assert.True(lines is
[
ObjectAddressOutputLine { Address.Span: "00007f9f1bfff138" },
TypeNameOutputLine { TypeName.Span: "System.StackOverflowException" },
MethodTableOutputLine { MethodTable.Span: "00007f9f540ff000" },
EEClassAddressOutputLine { EEClassAddress.Span: "00007f9f540d81a8" },
ObjectAddressOutputLine { Address: "00007f9f1bfff138" },
TypeNameOutputLine { TypeName: "System.StackOverflowException" },
MethodTableOutputLine { MethodTable: "00007f9f540ff000" },
EEClassAddressOutputLine { EEClassAddress: "00007f9f540d81a8" },
{},
{},
{},
{},
{},
DumpObjectOutputLine { MethodTable.Span: "00007f9f54381c38" },
DumpObjectOutputLine { MethodTable.Span: "00007f9f540fd2e0" },
DumpObjectOutputLine { MethodTable.Span: "00007f9f54101250" },
DumpObjectOutputLine { MethodTable.Span: "00007f9f540fec90" },
DumpObjectOutputLine { MethodTable.Span: "00007f9f540fd2e0" },
DumpObjectOutputLine { MethodTable.Span: "00007f9f54b986b8" },
DumpObjectOutputLine { MethodTable: "00007f9f54381c38" },
DumpObjectOutputLine { MethodTable: "00007f9f540fd2e0" },
DumpObjectOutputLine { MethodTable: "00007f9f54101250" },
DumpObjectOutputLine { MethodTable: "00007f9f540fec90" },
DumpObjectOutputLine { MethodTable: "00007f9f540fd2e0" },
DumpObjectOutputLine { MethodTable: "00007f9f54b986b8" },
{},
{}
]);
Expand Down
Loading

0 comments on commit cda2717

Please sign in to comment.