首页 > 解决方案 > WinDbg !dumpmodule 看不到所有类

问题描述

添加到 simpleWpfApplication默认情况下,它有一个命名空间和两个类。

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 预览

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

标签: c#wpfwindbg

解决方案


推荐阅读