NetRoc's Blog

N-Tech

 

WinDbg 文档翻译----82

cc682/NetRoc

http://netroc682.spaces.live.com/

!mca

在x86目标机上,!mca 扩展用于显示机器检查架构(machine check architecture (MCA))寄存器。在Itanium目标机上,!mca用于显示MCA错误记录。

语法

x86 目标机语法

!mca 

Itanium目标机语法

!mca Address [Flags

参数

Address

(仅Itanium目标) 指定MCA错误记录的地址。

Flags

(仅Itanium目标) 指定显示级别。Flags 可以是下面这些位的任意组合。默认值为0xFF,会显示日志中的所有部分(section)。

Bit 0 (0x1)

显示处理器部分(section)。

Bit 1 (0x2)

显示平台相关部分(platform-specific section)。

Bit 2 (0x4)

显示内存部分(memory section)

Bit 3 (0x8)

显示PCI组件部分。

Bit 4 (0x10)

显示PCI总线部分。

Bit 5 (0x20)

显示SystemEvent Log部分。

Bit 6 (0x40)

显示平台控制器(platform host controller)部分。

Bit 7 (0x80)

显示平台总线(platform bus)部分。

DLL

Windows NT 4.0

Kdextx86.dll

Windows 2000

Kdextx86.dll

Windows XP和之后

Kdexts.dll

该扩展命令只能针对x86或Itanium目标机使用。

注释

在Itanium目标上,!mca 显示系统抽象层(system abstraction layer (SAL))中的MCA错误记录。下面是该扩展输出的示例:

kd> !mca e0000165f3f58000
hal!HalpFeatureBits: 0xf [HAL_PERF_EVENTS|HAL_MCA_PRESENT|HAL_CMC_PRESENT|HAL_CPE_PRESENT]
 
MCA Error Record Header @ 0xe0000165f3f58000 0xe0000165f3f597a8
   Id               : 8
   Revision         :
      Revision         : 2
      Minor            : 0x2 ''
      Major            : 0 ''
   ErrorSeverity    : 0 ''
   Valid            :
      Valid            : 0 ''
      OemPlatformID    : 0y0
      Reserved         : 0y0000000 (0)
   Length           : 0x17a8
   TimeStamp        :
      TimeStamp        : 0x20031106`00134944
      Seconds          : 0x44 'D'
      Minutes          : 0x49 'I'
      Hours            : 0x13 ''
      Reserved         : 0 ''
      Day              : 0x6 ''
      Month            : 0x11 ''
      Year             : 0x3 ''
      Century          : 0x20 ' '
   OemPlatformId    : [16]  ""
 

   Severity  : ErrorRecoverable
 
MCA Error Section Header @ 0xe0000165f3f58028 0xe0000165f3f59578   [Processor]
   Header           :
      Guid             :
         Data1            : 0xe429faf1
         Data2            : 0x3cb7
         Data3            : 0x11d4
         Data4            : [8]  "???"
      Revision         :
         Revision         : 2
         Minor            : 0x2 ''
         Major            : 0 ''
      RecoveryInfo     :
         RecoveryInfo     : 0 ''
         Corrected        : 0y0
         NotContained     : 0y0
         Reset            : 0y0
         Reserved         : 0y0000
         Valid            : 0y0
      Reserved         : 0 ''
      Length           : 0x1550
   Valid            :
      Valid            : 0x100101f
      ErrorMap         : 0y1
      StateParameter   : 0y1
      CRLid            : 0y1
      StaticStruct     : 0y1
      CacheCheckNum    : 0y0001
      TlbCheckNum      : 0y0000
      BusCheckNum      : 0y0001
      RegFileCheckNum  : 0y0000
      MsCheckNum       : 0y0000
      CpuIdInfo        : 0y1
      Reserved         : 0y000000000000000000000000000000000000000 (0)
   ErrorMap         :
      ErrorMap         : 0x1002000
      Cid              : 0y0000
      Tid              : 0y0000
      Eic              : 0y0000
      Edc              : 0y0010
      Eit              : 0y0000
      Edt              : 0y0000
      Ebh              : 0y0001
      Erf              : 0y0000
      Ems              : 0y0000000000000000 (0)
      Reserved         : 0y0000000000000000 (0)
   StateParameter   :
      StateParameter   : 0x28000000`fff21130
      reserved0        : 0y00
      rz               : 0y0
      ra               : 0y0
      me               : 0y1
      mn               : 0y1
      sy               : 0y0
      co               : 0y0
      ci               : 0y1
      us               : 0y0
      hd               : 0y0
      tl               : 0y0
      mi               : 0y1
      pi               : 0y0
      pm               : 0y0
      dy               : 0y0
      in               : 0y0
      rs               : 0y1
      cm               : 0y0
      ex               : 0y0
      cr               : 0y1
      pc               : 0y1
      dr               : 0y1
      tr               : 0y1
      rr               : 0y1
      ar               : 0y1
      br               : 0y1
      pr               : 0y1
      fp               : 0y1
      b1               : 0y1
      b0               : 0y1
      gr               : 0y1
      dsize            : 0y0000000000000000 (0)
      reserved1        : 0y00000000000 (0)
      cc               : 0y1
      tc               : 0y0
      bc               : 0y1
      rc               : 0y0
      uc               : 0y0
   CRLid            :
      LocalId          : 0
      reserved         : 0y0000000000000000 (0)
      eid              : 0y00000000 (0)
      id               : 0y00000000 (0)
      ignored          : 0y00000000000000000000000000000000 (0)
 
   CacheErrorInfo[0]:
 
   Valid            : 1
   CheckInfo        : 0y1
   RequestorIdentifier : 0y0
   ResponderIdentifier : 0y0
   TargetIdentifier : 0y0
   PreciseIP        : 0y0
   Reserved         : 0y00000000000000000000000000000000000000000000000000000000000 (0)
   CheckInfo       : 0x0
   RequestorId     : 0x0
   ResponderId     : 0x0
   TargetIp        : 0x0
   TargetId        : 0x0
   PreciseIp       : 0x0
 
   CheckInfo:
 
   CacheCheck       : 0
   Operation        : 0y0000
   Level            : 0y00
   Reserved1        : 0y00
   DataLine         : 0y0
   TagLine          : 0y0
   DataCache        : 0y0
   InstructionCache : 0y0
   MESI             : 0y000
   MESIValid        : 0y0
   Way              : 0y00000 (0)
   WayIndexValid    : 0y0
   Reserved2        : 0y0000000000 (0)
   Index            : 0y00000000000000000000 (0)
   Reserved3        : 0y00
   InstructionSet   : 0y0
   InstructionSetValid : 0y0
   PrivilegeLevel   : 0y00
   PrivilegeLevelValid : 0y0
   MachineCheckCorrected : 0y0
   TargetAddressValid : 0y0
   RequestIdValid   : 0y0
   ResponderIdValid : 0y0
   PreciseIPValid   : 0y0
 

   BusErrorInfo[0]:
 
   Valid            : 9
   CheckInfo        : 0y1
   RequestorIdentifier : 0y0
   ResponderIdentifier : 0y0
   TargetIdentifier : 0y1
   PreciseIP        : 0y0
   Reserved         : 0y00000000000000000000000000000000000000000000000000000000000 (0)
   CheckInfo       : 0x1080000003000144
   RequestorId     : 0x0
   ResponderId     : 0x0
   TargetIp        : 0x0
   TargetId        : 0xd0022004
   PreciseIp       : 0x0
 
   CheckInfo:
 
   BusCheck         : 0x10800000`03000144
   Size             : 0y00100 (0x4)
   Internal         : 0y0
   External         : 0y1
   CacheTransfer    : 0y0
   Type             : 0y00000001 (0x1)
   Severity         : 0y00000 (0)
   Hierarchy        : 0y00
   Reserved1        : 0y0
   Status           : 0y00000011 (0x3)
   Reserved2        : 0y0000000000000000000000 (0)
   InstructionSet   : 0y0
   InstructionSetValid : 0y1
   PrivilegeLevel   : 0y00
   PrivilegeLevelValid : 0y0
   MachineCheckCorrected : 0y0
   TargetAddressValid : 0y1
   RequestIdValid   : 0y0
   ResponderIdValid : 0y0
   PreciseIPValid   : 0y0
 
   StaticInfo @ 0xe0000165f3f580f0 0xe0000165f3f59578
 
   Valid @ 0xe0000165f3f580f0
 
   Valid            : 0x3f
   MinState         : 0y1
   BR               : 0y1
   CR               : 0y1
   AR               : 0y1
   RR               : 0y1
   FR               : 0y1
   Reserved         : 0y0000000000000000000000000000000000000000000000000000000000 (0)
 
   MinState @ 0xe0000165f3f580f8 0xe0000165f3f584f0
 
   IntNats          : 0
   IntGp            : 0xe0000165`f1a99b00
   IntT0            : 0
   IntT1            : 0xe0f0e0f0`e0f0e000
   IntS0            : 0
   IntS1            : 1
   IntS2            : 0xe0000000`83068300
   IntS3            : 0xe0000000`832f8780
   IntV0            : 0x4600
   IntT2            : 0x230
   IntT3            : 0x3ff
   IntT4            : 0xe0000165`f38c6000
   IntSp            : 0xe0000165`f0f97da0
   IntTeb           : 0
   IntT5            : 0
   IntT6            : 0xfffff630
   B0R16            : 0x1010`082a6018
   B0R17            : 0
   B0R18            : 0xe0000000`830067c0
   B0R19            : 0x101
   B0R20            : 0x80000000`00000308
   B0R21            : 0
   B0R22            : 0xe0000000`84bedd20
   B0R23            : 0xe0000000`84bedd20
   B0R24            : 0xe0000165`f213df5a
   B0R25            : 0xfff80000`597c84f0
   B0R26            : 0x6081
   B0R27            : 0xfffffe00`00165f20
   B0R28            : 0x8000465
   B0R29            : 0x8000465
   B0R30            : 0x60
   B0R31            : 0xa04`00000000
   IntT7            : 0x44
   IntT8            : 0x200
   IntT9            : 0xe0000165`f38c6000
   IntT10           : 0xe0000165`f3cb81bc
   IntT11           : 0xe0000165`f3cb81b8
   IntT12           : 0xe0000000`8363f7b0
   IntT13           : 0xe0000165`f1899d08
   IntT14           : 0x9804c`8a70433f
   IntT15           : 0xe0000000`832821f8
   IntT16           : 0xe0000000`836536e0
   IntT17           : 0xe0000000`8363f7b8
   IntT18           : 0xffffffff`fffffbc3
   IntT19           : 0xe0000165`f1ff6000
   IntT20           : 0x2400580
   IntT21           : 0xe0000165`f1ff6004
   IntT22           : 0xe0000165`f3cb8dc0
   Preds            : 0x2277
   BrRp             : 0xe0000165`ea212df0
   RsRSC            : 3
   StIIP            : 0xe0000165`f1895370
   StIPSR           : 0x1010`082a6018
   StIFS            : 0x80000000`00000285
   XIP              : 0xe0000165`ea212c50
   XPSR             : 0x1010`082a6018
   XFS              : 0x80000000`00000b1c
 
   BR @ 0xe0000165f3f584f8 0xe0000165f3f58530
 
e0000165`f3f584f8  e0000165`ea212df0 USBPORT!USBPORT_StopDevice+0x850
e0000165`f3f58500  00000000`00000000
e0000165`f3f58508  00000000`00000000
e0000165`f3f58510  00000000`00000000
e0000165`f3f58518  00000000`00000000
e0000165`f3f58520  00000000`00000000
e0000165`f3f58528  e0000000`832cb061 nt!NtClose+0x1
e0000165`f3f58530  e0000165`f1895320 usbohci!OHCI_StopController
 
   CR @ 0xe0000165f3f58538 0xe0000165f3f58930
 
e0000165`f3f58538  00000000`00007e05
e0000165`f3f58540  00000154`a7047201
e0000165`f3f58548  e0000000`83230000 nt!KiVhptTransVector
e0000165`f3f58550  00000000`00000000
...
e0000165`f3f585c8  00000000`00000000
e0000165`f3f585d0  e0000165`f1895370 usbohci!OHCI_StopController+0x50
e0000165`f3f585d8  e0000165`f213df5a
e0000165`f3f585e0  00000000`00000060
e0000165`f3f585e8  e0000165`f1895360 usbohci!OHCI_StopController+0x40
e0000165`f3f585f0  80000000`00000285
...
e0000165`f3f58930  00000000`00000000
 
   AR @ 0xe0000165f3f58938 0xe0000165f3f58d30
 
e0000165`f3f58938  00000000`00000000
e0000165`f3f58940  00000000`00000000
e0000165`f3f58948  00000000`00000000
e0000165`f3f58950  00000000`00000000
e0000165`f3f58958  00000000`00000000
e0000165`f3f58960  00000000`00000006
e0000165`f3f58968  e0000000`8301add0 nt!KiMemoryFault
e0000165`f3f58970  00000000`00000000
e0000165`f3f58978  00000000`00000000
e0000165`f3f58980  00000000`00000000
e0000165`f3f58988  00000000`00000000
e0000165`f3f58990  00000000`00000000
e0000165`f3f58998  00000000`00000000
e0000165`f3f589a0  00000000`00000000
e0000165`f3f589a8  00000000`00000000
e0000165`f3f589b0  00000000`00000000
e0000165`f3f589b8  e0000165`f1895370 usbohci!OHCI_StopController+0x50
e0000165`f3f589c0  e0000165`f0f988e0
...
e0000165`f3f58d30  00000000`00000000
 
   RR @ 0xe0000165f3f58d38 0xe0000165f3f58d70
 
e0000165`f3f58d38  00000000`00000535
e0000165`f3f58d40  00000000`00000535
e0000165`f3f58d48  00000000`00000535
e0000165`f3f58d50  00000000`00000535
e0000165`f3f58d58  00000000`00000535
e0000165`f3f58d60  00000000`00000535
e0000165`f3f58d68  00000000`00000535
e0000165`f3f58d70  00000000`00000535
 
   FR @ 0xe0000165f3f58d78 0xe0000165f3f59570
 
e0000165`f3f58d78  00000000`00000000
e0000165`f3f58d80  00000000`00000000
e0000165`f3f58d88  80000000`00000000
e0000165`f3f58d90  00000000`0000ffff
e0000165`f3f58d98  00000000`00000000
e0000165`f3f58da0  00000000`00000000
e0000165`f3f58da8  00000000`00000000
e0000165`f3f58db0  00000000`00000000
...
e0000165`f3f59570  00000000`00000000
 

MCA Error Section Header @ 0xe0000165f3f59578 0xe0000165f3f596a0   [PciComponent]
   Header           :
      Guid             :
         Data1            : 0xe429faf6
         Data2            : 0x3cb7
         Data3            : 0x11d4
         Data4            : [8]  "???"
      Revision         :
         Revision         : 2
         Minor            : 0x2 ''
         Major            : 0 ''
      RecoveryInfo     :
         RecoveryInfo     : 0x80 ''
         Corrected        : 0y0
         NotContained     : 0y0
         Reset            : 0y0
         Reserved         : 0y0000
         Valid            : 0y1
      Reserved         : 0 ''
      Length           : 0x128
   Valid            :
      Valid            : 0x23
      ErrorStatus      : 0y1
      Info             : 0y1
      MemoryMappedRegistersPairs : 0y0
      ProgrammedIORegistersPairs : 0y0
      RegistersDataPairs : 0y0
      OemData          : 0y1
      Reserved         : 0y0000000000000000000000000000000000000000000000000000000000 (0)
   ErrorStatus      :
      Status           : 0x121900
      Reserved0        : 0y00000000 (0)
      Type             : 0y00011001 (0x19)
      Address          : 0y0
      Control          : 0y1
      Data             : 0y0
      Responder        : 0y0
      Requestor        : 0y1
      FirstError       : 0y0
      Overflow         : 0y0
      Reserved1        : 0y00000000000000000000000000000000000000000 (0)
   Info             :
      VendorId         : 0x8086
      DeviceId         : 0x100e
      ClassCodeInterface : 0 ''
      ClassCodeSubClass : 0 ''
      ClassCodeBaseClass : 0x2 ''
      FunctionNumber   : 0 ''
      DeviceNumber     : 0x3 ''
      BusNumber        : 0xa0 ''
      SegmentNumber    : 0 ''
      Reserved0        : 0 ''
      Reserved1        : 0
   MemoryMappedRegistersPairs : 0
   ProgrammedIORegistersPairs : 0
 
   OemData @ 0xe0000165f3f595b8   0xe0000165f3f596a0
 
      Data Length = 0xe6
      Data:
e0000165`f3f595ba  00 00 00 00 00 00 91 d3-86 d3 7a 5e 7e 48 a4 0a  ..........z^~H..
e0000165`f3f595ca  2b f6 f7 a6 cc ca 00 ff-ff ff ff ff ff ff 09 00  +...............
e0000165`f3f595da  00 00 00 00 00 00 00 00-00 00 08 00 00 00 86 80  ................
e0000165`f3f595ea  0e 10 47 01 30 22 08 00-00 00 08 00 00 00 02 00  ..G.0"..........
e0000165`f3f595fa  00 02 20 80 00 00 10 00-00 00 08 00 00 00 00 00  .. .............
e0000165`f3f5960a  00 d0 00 00 00 00 18 00-00 00 08 00 00 00 81 a0  ................
e0000165`f3f5961a  00 00 00 00 00 00 20 00-00 00 08 00 00 00 00 00  ...... .........
e0000165`f3f5962a  00 00 00 00 00 00 28 00-00 00 08 00 00 00 00 00  ......(.........
e0000165`f3f5963a  00 00 3c 10 74 12 30 00-00 00 08 00 00 00 00 00  ..<.t.0.........
e0000165`f3f5964a  00 00 dc 00 00 00 38 00-00 00 08 00 00 00 00 00  ......8.........
e0000165`f3f5965a  00 00 2a 01 ff 00 e4 00-00 00 08 00 00 00 07 f0  ..*.............
e0000165`f3f5966a  1e 00 00 00 40 04 00 00-00 00 00 00 00 00 00 00  ....@...........
e0000165`f3f5967a  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
e0000165`f3f5968a  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
e0000165`f3f5969a  00 00 00 00 00 00                                ......
 

MCA Error Section Header @ 0xe0000165f3f596a0 0xe0000165f3f597a8   [PciBus]
   Header           :
      Guid             :
         Data1            : 0xe429faf4
         Data2            : 0x3cb7
         Data3            : 0x11d4
         Data4            : [8]  "???"
      Revision         :
         Revision         : 2
         Minor            : 0x2 ''
         Major            : 0 ''
      RecoveryInfo     :
         RecoveryInfo     : 0x84 ''
         Corrected        : 0y0
         NotContained     : 0y0
         Reset            : 0y1
         Reserved         : 0y0000
         Valid            : 0y1
      Reserved         : 0 ''
      Length           : 0x108
   Valid            :
      Valid            : 0x74f
      ErrorStatus      : 0y1
      ErrorType        : 0y1
      Id               : 0y1
      Address          : 0y1
      Data             : 0y0
      CmdType          : 0y0
      RequestorId      : 0y1
      ResponderId      : 0y0
      TargetId         : 0y1
      OemId            : 0y1
      OemData          : 0y1
      Reserved         : 0y00000000000000000000000000000000000000000000000000000 (0)
   ErrorStatus      :
      Status           : 0x121900
      Reserved0        : 0y00000000 (0)
      Type             : 0y00011001 (0x19)
      Address          : 0y0
      Control          : 0y1
      Data             : 0y0
      Responder        : 0y0
      Requestor        : 0y1
      FirstError       : 0y0
      Overflow         : 0y0
      Reserved1        : 0y00000000000000000000000000000000000000000 (0)
   Type             :
      Type             : 0x4 ''
      Reserved         : 0 ''
   Id               :
      BusNumber        : 0xa0 ''
      SegmentNumber    : 0 ''
   Reserved         : [4]  ""
   Address          : 0xd0022054
   Data             : 0
   CmdType          : 0
   RequestorId      : 0xfed2a000
   ResponderId      : 0
   TargetId         : 0xd0022054
   OemId            : [16]  ".???"
   OemData          :
      Length           : 0x98
 
 
 
CP M/R/F/A Manufacturer     SerialNumber     Features         Speed
 0 1,5,31,0 GenuineIntel     0000000000000000 0000000000000001 1000 Mhz

在x86目标上,!mca 显示由活动处理器支持的machine check 寄存器。还会显示基本的CPU信息(和!cpuinfo显示的一样)。下面是该扩展的输出示例:

0: kd> !mca
MCE: Enabled, Cycle Address: 0x00000001699f7a00, Type: 0x0000000000000000

MCA: Enabled, Banks 5, Control Reg: Supported, Machine Check: None.
Bank  Error  Control Register     Status Register
  0. None   0x000000000000007f   0x0000000000000000

  1. None   0x00000000ffffffff   0x0000000000000000

  2. None   0x00000000000fffff   0x0000000000000000

  3. None   0x0000000000000007   0x0000000000000000

  4. None   0x0000000000003fff   0x0000000000000000

No register state available.

CP F/M/S Manufacturer   MHz Update Signature Features
 0 15,5,0 SomeBrandName 1394 0000000000000000 a0017fff

注意该扩展需要HAL的私有符号。如果没有这些符号,扩展命令会显示信息"HalpFeatureBits not found",以及基本CPU信息。例如 :

kd> !mca
HalpFeatureBits not found
CP F/M/S Manufacturer  MHz Update Signature Features
 0 6,5,1 GenuineIntel  334 0000004000000000 00001fff

!memlist

!memlist 扩展用来扫描页面帧序号数据库(page frame number (PFN) database)中的物理内存列表,以检查它们的一致性。

语法

!memlist Flags 

参数

Flags

指定要校验的内存。目前只实现了下面这一个值:

Bit 0 (0x1)

校验零页面列表(zeroed pages list)。

DLL

Windows NT 4.0

Kdexts.dll

Windows 2000

Kdexts.dll

Windows XP和之后

Kdexts.dll

 

注释

目前,该扩展命令只检查零页面列表(zeroed pages list )来确认是否该列表中所有页面都被用0填充了。使用的语法如下:

kd> !memlist 1

!memusage

!memusage 扩展显示物理内存使用的摘要统计。

语法

Windows 2000和之后的语法

!memusage 

Windows XP和之后的语法

!memusage [Flags]

Flags

(Windows XP和之后) 可以是下面这些值的任意一个。默认为0x0。

0x0

显示一般摘要信息,以及对PFN数据库中的页面更详细一些的说明。查看注释节获得这种输出的示例。

0x1

仅显示PFN数据库中已修改的非写页面(no-write page)的摘要信息。

0x2

仅显示PFN数据库中已修改的非写页面(no-write page)的详细信息。

0x8

仅显示内存使用的一般摘要信息。

DLL

Windows NT 4.0

Kdextx86.dll

Windows 2000

Kdextx86.dll

Windows XP和之后

Kdexts.dll

注释

物理内存统计是由内存管理器(Memory Manager)的页面帧序号(PFN)数据库搜集的。

由于需要获取大量数据,该命令需要运行较长时间,特别是当目标机运行在64位模式时。加载PFN数据库时,会由一个计数器来显示进度。要加快这种加载,可以通过CTRL+A (Toggle Baud Rate) 键增加COM口的速度,或者使用, .cache (Set Cache Size) 命令增加缓存大小(可能大约在10 MB左右)。

!memusage 命令也可以在本地内核调试时使用。

下面是该命令输出的一个例子:

kd> !memusage
 loading PFN database
loading (98% complete)

Compiling memory usage data (100% Complete).
             Zeroed:     49 (   196 kb)
               Free:      5 (    20 kb)
            Standby:   5489 ( 21956 kb)
           Modified:    714 (  2856 kb)
    ModifiedNoWrite:      1 (     4 kb)
       Active/Valid:  10119 ( 40476 kb)
         Transition:      6 (    24 kb)
            Unknown:      0 (     0 kb)
              TOTAL:  16383 ( 65532 kb)

  Building kernel map
  Finished building kernel map
Scanning PFN database - (99% complete) 

  Usage Summary (in Kb):


Control Valid Standby Dirty Shared Locked PageTables  name

8251a258    12    108     0     0     0     0  mapped_file( cscui.dll )
827ab1b8     8   1708     0     0     0     0  mapped_file( $Mft )
8263c408   908     48     0     0     0     0  mapped_file( win32k.sys )
8252dda8     0    324     0     0     0     0  mapped_file( ShellIconCache )
8272f638   128    112     0   116     0     0  mapped_file( advapi32.dll )
......
82755958     0      4     0     0     0     0  mapped_file( $Directory )
8250b518     0      4     0     0     0     0    No Name for File
8254d8d8     0      4     0     0     0     0  mapped_file( $Directory )
82537be8     0      4     0     0     0     0  mapped_file( Windows Explorer.lnk )

--------  1348      0     0 ----- -----   904  process ( System )
--------   492      0     0 ----- -----    72  process ( winmine.exe )
--------  3364   1384  1396 ----- -----   188  process ( explorer.exe )
--------   972      0     0 ----- -----    88  process ( services.exe )
--------   496   1456   384 ----- -----   164  process ( winmgmt.exe )
--------  1144      0     0 ----- -----   120  process ( svchost.exe )
--------   944      0     0 ----- -----   156  process ( winlogon.exe )
--------   412      0     0 ----- -----    64  process ( csrss.exe )
......
--------    12      0     0 ----- -----     8  process ( wmiadap.exe )

--------   316      0     0 ----- -----     0  pagefile section (346e)
--------  4096      0     0 ----- -----     0  pagefile section (9ad)

--------   884    280    36 -----     0 -----  driver ( ntoskrnl.exe )
--------    88      8     0 -----     0 -----  driver ( hal.dll )
--------     8      0     0 -----     0 -----  driver ( kdcom.dll )
--------    12      0     0 -----     0 -----  driver ( BOOTVID.dll )
......
--------     8      0     0 -----     0 -----  driver ( ndisuio.sys )
--------    16      0     0 -----     0 -----  driver ( dump_scsiport.sys )
--------    56      0     0 -----     0 -----  driver ( dump_aic78xx.sys )
--------  2756   1060   876 -----     0 -----  driver ( Paged Pool )
--------  1936    128   148 -----     0 -----  driver ( Kernel Stacks )
--------     0      0     0 -----     0 -----  driver ( NonPaged Pool )

第一列显示用来描述每个已映射结构(mapped structure)的控制域结构(control area structure)地址。使用!ca 扩展命令可以显示这些控制域。

注释

使用 !vm 扩展命令可以分析虚拟内存使用。该命令一般比!memusage要更有用些。关于内存管理的信息,查看Mark Russinovich 和David Solomon 编写的Microsoft Windows Internals

!pfn 扩展命令可以用来查看PFN数据库中某个特定页面帧。

!mps

!mps 扩展显示目标机中Intel 多处理器规范(Multiprocessor Specification (MPS))的BIOS信息。

语法

!mps [Address

参数

Address

指定BIOS中MPS表的16进制地址。如果省略,则从HAL中获取该信息。这需要HAL的符号。

DLL

Windows NT 4.0

Kdextx86.dll

Windows 2000

Kdextx86.dll

Windows XP和之后

Kdexts.dll

该扩展命令仅对x86目标机使用。

附加信息

关于BIOS调试的更多信息,查看调试BIOS代码。关于MPS的信息,查看Intel MultiProcessor Specification的适当版本。

!mtrr

!mtrr 扩展显示MTRR寄存器的内容。

语法

!mtrr 

DLL

Windows NT 4.0

Kdextx86.dll

Windows 2000

Kdextx86.dll

Windows XP和之后

Kdexts.dll

该扩展命令只能用于x86目标机。

!npx

!npx 扩展显示浮点寄存器保存区域(floating-point register save area)的内容。

语法

!npx Address 

参数

Address

指定FLOATING_SAVE_AREA 结构的16进制地址。

DLL

Windows NT 4.0

Kdextx86.dll

Windows 2000

Kdextx86.dll

Windows XP和之后

Kdexts.dll

该扩展命令只能用于x86目标机。

!ob, !od, !ow

!ob!od、以及!ow 扩展命令已废除。使用ob, od, ow (Output to Port) 命令来替代。

!object

!object 扩展显示某个系统对象。

语法

Windows NT 4.0的语法

!object Address 
!object 0 Name 
!object \ 

Windows 2000和之后的语法

!object Address 
!object 0 Name 
!object Path 
!object -r 

参数

Address

如果第一个参数是非0的16进制数字,则指定要显示信息的系统对象的16进制地址。

Name

如果第一个参数为0,则第二个参数是要显示所有实例的系统对象类型的名字。

Path

如果第一个参数以反斜线开头 (\), !object 将它当作一个对象路径的名字(object path name)。使用该选项时,会根据对象管理器(Object Manager)的目录结构来进行显示。

\

(仅Windows NT 4.0) 指定根目录对象(root directory object)。

-r

(Windows 2000 和之后) 使得被缓存的全局变量的值被刷新。

DLL

Windows NT 4.0

Kdextx86.dll

Windows 2000

Kdextx86.dll

Windows XP和之后

Kdexts.dll

注释

!object 扩展会缓存一些值能够被改变的特定的全局变量。如果使用的内核符号已经过期,可以使用!object –r来刷新缓存的值。

下面的例子用!handle 扩展来获得对象指针:

kd> !handle
processor number 0
PROCESS 80a02920  Cid: 0002    Peb: 00000000  ParentCid: 0000
    DirBase: 0006c805  ObjectTable: 80a03788  TableSize:  54.
    Image: System
006c: Object: 80967768  GrantedAccess: 00100003
Object: 80967768  Type: (809d5c20) File
    ObjectHeader: 80967750
        HandleCount: 1  PointerCount: 1
        Directory Object: 00000000  Name: \WINNT\system32\config\software {Partition1}

kd> !object 80967768
Object: 80967768  Type: (809d5c20) File
    ObjectHeader: 80967750
    HandleCount: 1  PointerCount: 1
    Directory Object: 00000000  Name: \WINNT\system32\config\software {Partition1}

附加信息

关于对象和对象管理器的信息,查看Microsoft Windows SDK文档、Windows Driver Kit (WDK)文档、以及Mark Russinovich 和David Solomon 编写的Microsoft Windows Internals

!obtrace

!obtrace 扩展显示指定对象的对象引用数据。

语法

!obtrace Object 

参数

Object

指向对象的指针或者路径。

DLL

Windows NT 4.0

不可用

Windows 2000

不可用

Windows XP和之后

Kdexts.dll

注释

Windows的对象引用跟踪功能会在每次对象的引用计数增加或者减少时记录调用堆栈。

使用该扩展命令来显示对象引用跟踪数据前,必须用GFlags来对指定的对象启用对象引用跟踪(object reference tracing) 。可以通过内核标志(运行时)设置来启用对象引用跟踪,这种改变会立即生效,但是关闭或重起之后消失;也可以通过注册表设置,这种设置需要重起,但是如果没有改变的话会一直保持下去。

下面是!obtrace 扩展的输出示例:

kd> !obtrace 0xfa96f700
Object: fa96f700        Image: cmd.exe
Sequence  (+/-)  Stack
--------  -----  ---------------------------------------------------
   2421d    +1  nt!ObCreateObject+180
                nt!NtCreateEvent+92
                nt!KiFastCallEntry+104
                nt!ZwCreateEvent+11
                win32k!UserThreadCallout+6f
                win32k!W32pThreadCallout+38
                nt!PsConvertToGuiThread+174
                nt!KiBBTUnexpectedRange+c

   2421e    -1  nt!ObfDereferenceObject+19
                nt!NtCreateEvent+d4
                nt!KiFastCallEntry+104
                nt!ZwCreateEvent+11
                win32k!UserThreadCallout+6f
                win32k!W32pThreadCallout+38
                nt!PsConvertToGuiThread+174
                nt!KiBBTUnexpectedRange+c

   2421f    +1  nt!ObReferenceObjectByHandle+1c3
                win32k!xxxCreateThreadInfo+37d
                win32k!UserThreadCallout+6f
                win32k!W32pThreadCallout+38
                nt!PsConvertToGuiThread+174
                nt!KiBBTUnexpectedRange+c

   24220    +1  nt!ObReferenceObjectByHandle+1c3
                win32k!ProtectHandle+22
                win32k!xxxCreateThreadInfo+3a0
                win32k!UserThreadCallout+6f
                win32k!W32pThreadCallout+38
                nt!PsConvertToGuiThread+174
                nt!KiBBTUnexpectedRange+c

   24221    -1  nt!ObfDereferenceObject+19
                win32k!xxxCreateThreadInfo+3a0
                win32k!UserThreadCallout+6f
                win32k!W32pThreadCallout+38
                nt!PsConvertToGuiThread+174
                nt!KiBBTUnexpectedRange+c

----  ----------------------------------------------------------
References: 3, Dereferences 2

!obtrace 0xfa96f700显示出来的主要指示符在下表中列出。

参数

意义

Sequence

表示操作的顺序。

+/-

表示引用或者取消引用的操作。

+1表示一次引用操作。

-1表示一次取消引用操作。

+/-n 表示多次的引用/取消引用操作。

 

在x64目标机上的对象引用跟踪可能不完全,因为在IRQL高于PASSIVE_LEVEL 的时候并不一定能够取到调用堆栈。

任何时候可以通过按下CTRL+BREAK (WinDbg) 或CTRL+C (KD)中止命令。

附加信息

关于全局标志实用工具(GFlags)的更多信息,查看Windows Driver Kit (WDK) 文档,以及Mark Russinovich 和David Solomon 编写的Microsoft Windows Internals

!openmaps

!openmaps 扩展显示指定的共享缓存映射(shared cache map)的引用缓冲区控制块(referenced buffer control blocks (BCBs)),和虚拟地址控制块(virtual address control blocks (VACBs))。

语法

!openmaps Address [Flag

参数

Address

指定共享缓存映射的地址。

Flag

指定要显示哪个控制块。如果Flag1,调试器显示所有控制块。如果Flag0,调试器仅显示引用控制块 (referenced control blocks)。默认值为0

DLL

Windows NT 4.0

不可用

Windows 2000

Kdextx86.dll

Windows XP和之后

Kdexts.dll

附加信息

关于缓存管理的信息,查看Microsoft Windows SDK文档,以及Mark Russinovich 和David Solomon 编写的Microsoft Windows Internals

关于其他缓存管理扩展命令的信息,查看!cchelp 扩展。

posted on 2008-07-24 14:44 NetRoc 阅读(608) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。

导航

统计

常用链接

留言簿(7)

随笔档案(99)

文章分类(35)

文章档案(32)

Friends

Mirror

搜索

最新评论

阅读排行榜

评论排行榜