Skip to content

Commit

Permalink
Add verbose info to clrmodules command. (#712)
Browse files Browse the repository at this point in the history
Add version info to modules command.
  • Loading branch information
mikem8361 authored Dec 19, 2019
1 parent 4dc8e35 commit 2162a20
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/SOS/Strike/strike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6030,6 +6030,7 @@ DECLARE_API(DumpModule)

ExtOut("PEFile: %p\n", SOS_PTR(module.File));
ExtOut("ModuleId: %p\n", SOS_PTR(module.dwModuleID));
ExtOut("ModuleIndex: %p\n", SOS_PTR(module.dwModuleIndex));
ExtOut("LoaderHeap: %p\n", SOS_PTR(module.pLookupTableHeap));
ExtOut("TypeDefToMethodTableMap: %p\n", SOS_PTR(module.TypeDefToMethodTableMap));
ExtOut("TypeRefToMethodTableMap: %p\n", SOS_PTR(module.TypeRefToMethodTableMap));
Expand Down
22 changes: 21 additions & 1 deletion src/Tools/dotnet-dump/Commands/ClrModulesCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,31 @@ public class ClrModulesCommand : CommandBase
{
public ClrRuntime Runtime { get; set; }

[Option(Name = "--verbose", Help = "Displays detailed information about the modules.")]
[OptionAlias(Name = "-v")]
public bool Verbose { get; set; }

public override void Invoke()
{
foreach (ClrModule module in Runtime.Modules)
{
WriteLine("{0:X16} {1}", module.Address, module.FileName);
if (Verbose)
{
WriteLine("{0}", module.FileName);
WriteLine(" Name: {0}", module.Name);
WriteLine(" ImageBase: {0:X16}", module.ImageBase);
WriteLine(" Size: {0:X8}", module.Size);
WriteLine(" Address: {0:X16}", module.Address);
WriteLine(" IsFile: {0}", module.IsFile);
WriteLine(" IsDynamic: {0}", module.IsDynamic);
WriteLine(" MetadataAddress: {0:X16}", module.MetadataAddress);
WriteLine(" MetadataSize: {0:X16}", module.MetadataLength);
WriteLine(" PdbInfo: {0}", module.Pdb?.ToString() ?? "<none>");
}
else
{
WriteLine("{0:X16} {1:X8} {2}", module.ImageBase, module.Size, module.FileName);
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/Tools/dotnet-dump/Commands/ModulesCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ public override void Invoke()
{
WriteLine("{0}", module.FileName);
WriteLine(" Address: {0:X16}", module.ImageBase);
WriteLine(" IsManaged: {0}", module.IsManaged);
WriteLine(" FileSize: {0:X8}", module.FileSize);
WriteLine(" TimeStamp: {0:X8}", module.TimeStamp);
WriteLine(" Version: {0}", module.Version);
WriteLine(" PdbInfo: {0}", module.Pdb?.ToString() ?? "<none>");
if (module.BuildId != null) {
WriteLine(" BuildId: {0}", string.Concat(module.BuildId.Select((b) => b.ToString("x2"))));
}
WriteLine(" IsManaged: {0}", module.IsManaged);
}
else
{
Expand Down

0 comments on commit 2162a20

Please sign in to comment.