WinDbg! Dumpmodule не видит все классы - PullRequest
1 голос
/ 31 января 2020

Добавлен к простому WpfApplication, по умолчанию он имеет одно пространство имен и два класса.

namespace WpfApp
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public void Foo1()
        {

        }
    }
}
namespace WpfApp
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public void Foo()
        {

        }
        public MainWindow()
        {
            InitializeComponent();
        }
    }
}

После выполнения команд

0:000> !name2ee WpfApp a
Module:      0265402c
Assembly:    WpfApp.exe

0:000> !dumpmodule -mt 0265402c
...
MetaData start address:  00072194 (3528 bytes)

Types defined in this module

      MT  TypeDef Name
------------------------------------------------------------------------------
026591d4 0x02000002 WpfApp.App

Types referenced in this module

      MT    TypeRef Name
------------------------------------------------------------------------------
705ef1c8 0x02000001 System.Runtime.CompilerServices.CompilationRelaxationsAttribute
705efba0 0x02000002 System.Runtime.CompilerServices.RuntimeCompatibilityAttribute
705ef268 0x02000003 System.Diagnostics.DebuggableAttribute
705ef6a0 0x02000005 System.Reflection.AssemblyTitleAttribute
705ef720 0x02000006 System.Reflection.AssemblyDescriptionAttribute
705ef6e0 0x02000007 System.Reflection.AssemblyConfigurationAttribute
705ef15c 0x02000008 System.Reflection.AssemblyCompanyAttribute
705ef11c 0x02000009 System.Reflection.AssemblyProductAttribute
705ef854 0x0200000a System.Reflection.AssemblyCopyrightAttribute
705ef894 0x0200000b System.Reflection.AssemblyTrademarkAttribute
705ef4c4 0x0200000c System.Runtime.InteropServices.ComVisibleAttribute
5890eb9c 0x0200000e System.Windows.ThemeInfoAttribute
705ef8d4 0x0200000f System.Reflection.AssemblyFileVersionAttribute
70640cbc 0x02000010 System.Runtime.Versioning.TargetFrameworkAttribute
5890ec5c 0x02000011 System.Windows.Application

Кажется, что 0:000> !dumpmodule -mt 0265402c показывает только один класс WpfApp.App. Но почему он не показывает WpfApp.MainWindow?

Windbg preview

Attributes: PEFile SupportsUpdateableMethods
Assembly:   026f0e78
LoaderHeap:              00000000
TypeDefToMethodTableMap: 02bd0038
TypeRefToMethodTableMap: 02bd0050
MethodDefToDescMap:      02bd00e0
FieldDefToDescMap:       02bd0120
MemberRefToDescMap:      00000000
FileReferencesMap:       02bd0138
AssemblyReferencesMap:   02bd013c
MetaData start address:  001d2194 (3524 bytes)

Types defined in this module

      MT  TypeDef Name
------------------------------------------------------------------------------
02bd91d4 0x02000002 WpfApp.App

Types referenced in this module

      MT    TypeRef Name
------------------------------------------------------------------------------
705ef1c8 0x02000001 System.Runtime.CompilerServices.CompilationRelaxationsAttribute
705efba0 0x02000002 System.Runtime.CompilerServices.RuntimeCompatibilityAttribute
705ef268 0x02000003 System.Diagnostics.DebuggableAttribute
705ef6a0 0x02000005 System.Reflection.AssemblyTitleAttribute
705ef720 0x02000006 System.Reflection.AssemblyDescriptionAttribute
705ef6e0 0x02000007 System.Reflection.AssemblyConfigurationAttribute
705ef15c 0x02000008 System.Reflection.AssemblyCompanyAttribute
705ef11c 0x02000009 System.Reflection.AssemblyProductAttribute
705ef854 0x0200000a System.Reflection.AssemblyCopyrightAttribute
705ef894 0x0200000b System.Reflection.AssemblyTrademarkAttribute
705ef4c4 0x0200000c System.Runtime.InteropServices.ComVisibleAttribute
54eceb9c 0x0200000e System.Windows.ThemeInfoAttribute
705ef8d4 0x0200000f System.Reflection.AssemblyFileVersionAttribute
70640cbc 0x02000010 System.Runtime.Versioning.TargetFrameworkAttribute
54ecec5c 0x02000011 System.Windows.Application
...