x (Examine Symbols)

x命令在所有与指定模式匹配的上下文中显示符号。

x [Options] Module!Symbol 
x [Options] *

参数:

  • Options
    特定符号搜索选项。您可以使用以下一个或多个选项:
    只显示每个符号的地址。

    只显示每个符号的名称。

    只显示每个符号 (而非数据类型) 的地址和名称。

    调试器标记语言显示输出。

    如果数据类型已知, 则显示每个符号的数据类型。

    大小始终以字节为单位进行度量并以十六进制格式显示。

    大小必须为非零整数。

    显示带引号格式的符号名称。

    如果要将函数名称和自变量从x显示复制到其他位置, 这种类型的显示可以简化。

    显示函数的数据大小。

    显示数据的数据大小。

    按地址对显示按升序排序。

    按地址降序排序。

    按名称对显示顺序进行升序排序。

    按名称对显示顺序按降序排序。

    按大小以升序对显示进行排序。

    按大小降序排序显示。

  • Module
    指定搜索模块。这个模块可以是EXE,DLL,或SYS文件。模块可以包含野生动物特性和规格的多样性。
  • Symbol
    指定符号必须包含的模式。符号可以包含各种通配符和说明符。由于此模式与符号匹配,因此匹配不区分大小写,并且单个前导下划线(u)表示任何数量的前导下划线。可以在符号中添加空格,以便可以指定包含空格的符号名称(例如“operator new”或“template<a,b>”),而不使用通配符。

环境:

模式

用户模式, 内核模式

目标

实时, 故障转储

平台

全部

spin" 的所有符号。

0:000> x mymodule!*spin* 

0:000> x mymodule!downloadm??or 

你还可以使用以下命令显示 MyModule 中的所有符号。

0:000> x mymodule!* 

如果要使用最小显示重载模块中的符号, 请使用以下命令。

0:000> x mymodule!*start* 

但前面的命令避免了过多的显示长度x mymodule*!

如果符号是全局变量, 则显示其当前值。

若要显示当前上下文的所有局部变量的地址和名称, 请使用以下命令。

0:000> x * 

dv (显示局部变量) 命令。

下面的示例演示 /0/1/2选项。

0:000:x86> x /0 MyApp!Add*
00b51410          
00b513d0 
      
0:000:x86> x /1 MyApp!Add*
MyApp!AddThreeIntegers
MyApp!AddTwoIntegers

0:000:x86> x /2 MyApp!Add*
00b51410          MyApp!AddThreeIntegers
00b513d0          MyApp!AddTwoIntegers

foreach命令的输入, 则 /0/1/2选项非常有用。

.foreach ( place { x /0 MyApp!*MySym*} ) { .echo ${place}+0x18 }

下面的示例演示用于在模块 notepad.exe 上筛选函数的开关 /f

0:000> x /f /v notepad!*main*
prv func   00000001`00003340  249 notepad!WinMain (struct HINSTANCE__ *, struct HINSTANCE__ *, char *, int)
prv func   00000001`0000a7b0   1c notepad!WinMainCRTStartup$filt$0 (void)
prv func   00000001`0000a540  268 notepad!WinMainCRTStartup (void)

还显示符号的源 (公共或完整符号信息)。

kd> x /v nt!CmType*
global 806c9e68    0 nt!CmTypeName = struct _UNICODE_STRING []
global 806c9e68  150 nt!CmTypeName = struct _UNICODE_STRING [42]
global 806c9e68    0 nt!CmTypeName = struct _UNICODE_STRING []
global 805bd7b0    0 nt!CmTypeString = unsigned short *[]
global 805bd7b0   a8 nt!CmTypeString = unsigned short *[42]

此数组的大小为 42*4 = 168, 168 以十六进制格式显示为0xA8。

例如, 可以将前面的示例中的命令限制为表示大小为0xA8 的对象的符号。

kd> x /v /s a8 nt!CmType*
global 805bd7b0   a8 nt!CmTypeString = unsigned short *[42]

使用数据类型

使用 /t时, 此类符号的数据类型信息显示两次。

0:001> x prymes!__n*
00427d84 myModule!__nullstring = 0x00425de8 "(null)"
0042a3c0 myModule!_nstream = 512
Type information missing error for _nh_malloc
004021c1 myModule!MyStructInstance = struct MyStruct
00427d14 myModule!_NLG_Destination = <no type information>

0:001> x /t prymes!__n*
00427d84 char * myModule!__nullstring = 0x00425de8 "(null)"
0042a3c0 int myModule!_nstream = 512
Type information missing error for _nh_malloc
004021c1 struct MyStruct myModule!MyStructInstance = struct MyStruct
00427d14 <NoType> myModule!_NLG_Destination = <no type information>

X 命令将显示某个类型的实例。

0:001> x foo!MyClassInstance
00f4f354          foo!MyClassInstance = 0x00f78768

X 命令不显示任何内容, 只基于类型的名称。

0:001> x foo!MyClass
0:001>

dt (显示类型) , 它提供类型和类型实例的信息:

0:001> dt foo!MyClass
   +0x000 IntMemberVariable : Int4B
   +0x004 FloatMemberVariable : Float
   +0x008 BoolMemberVariable : Bool
   +0x00c PtrMemberVariable : Ptr32 MyClass

使用模板

您可以使用包含 x 命令的通配符来显示模板类, 如本示例中所示。

dbgcmd
0:001>  x Fabric!Common::ConfigEntry*TimeSpan?
000007f6`466a2f9c Fabric!Common::ConfigEntry<Common::TimeSpan>::ConfigEntry<Common::TimeSpan> (void)
000007f6`466a3020 Fabric!Common::ConfigEntry<Common::TimeSpan>::~ConfigEntry<Common::TimeSpan> (void)

dt (显示类型) 命令, 因为 x 命令不显示单个模板类项。

0:001> dt foo!Common::ConfigEntry<Common::TimeSpan>
   +0x000 __VFN_table : Ptr64 
   +0x008 componentConfig_ : Ptr64 Common::ComponentConfig
   +0x010 section_         : std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >
   +0x038 key_             : std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >

相关文章:

  • 2021-12-21
  • 2021-07-12
  • 2021-08-09
  • 2021-10-14
  • 2021-11-15
  • 2021-08-11
  • 2022-02-26
猜你喜欢
  • 2021-06-05
  • 2021-07-09
  • 2021-10-16
  • 2021-06-11
  • 2021-12-28
  • 2022-02-27
  • 2021-09-05
相关资源
相似解决方案