[windbg]sosex大侠

官网:http://www.stevestechspot.com/default.aspx

 

用法,下载sosex.dll,放进你的“%systemroot%Microsoft.NET\Framework\v2.0.50727”

然后再windbg里执行

.loadby sosex mscorwks

 

Quick Ref:
--------------------------------------------------
dlk       (no parameters)                                   Displays sync block deadlocks
dumpgen   
<GenNum> [-free] [-stat] [-type <TYPE_NAME>]      Dumps the contents of the specified generation
gcgen     
<ObjectAddr>                                      Displays the GC generation of the specified object
help      [strCommandName]                                  Display 
this screen or details about the specified command
mbc       
<Managed breakpoint ID | *>                       Clears the specified or all managed breakpoints
mbd       
<Managed breakpoint ID | *>                       Disables the specified or all managed breakpoints
mbe       
<Managed breakpoint ID | *>                       Enables the specified or all managed breakpoints
mbl       (no parameters)                                   Lists all managed breakpoints
mbm       
<strTypeAndMethodFilter> [intILOffset] [Options]  Sets a managed breakpoint on methods matching the specified filter
mbp       
<strSourceFile> <nLineNum> [nColumNum> [Options]  Sets a managed breakpoint at the specified source code location
mdt       [strTypeName 
| strVarName | MT] [ADDR] [-r]       Displays the contents of an object or type, optionally recursively
mdv       [
-w]                                              Displays arguments and parameters for managed frames
mframe    [nFrameNum]                                       Displays or sets the current managed frame 
for the !mdt and !mdv commands
mk        [nFrameCount]                                     Prints a stack trace of managed and unmanaged frames
mln       
<address expression>                              Displays the type of managed data located at the specified address, if any
mx        
<Filter String>                                   Displays managed type/field/method names matching the specified filter string
refs      
<ObjectAddr>                                      Displays all references from and to the specified object
sosexhelp [CommandName]                                     Display 
this screen or details about the specified command
strings   [Options]                                         Lists all strings on managed heaps that match the specified criteria

Use 
!help <command> or !sosexhelp <command> for more details about each command.
``

*!dlk
Performs SyncBlock deadlock detection. If deadlocks are found, the held
/needed locks and thread info is displayed.
!dlk is only useful for managed SyncBlock deadlocks, eg. objects locked using Monitor.Enter

Note that the thread ID values reported are the CLR thread numbers, not the debugger native thread numbers.
Use the sos
!threads command to see the corresponding debugger native thread number.

Sample output:

0:011> !sosex.dlk
Deadlock detected:
CLR thread 
3 is DEAD, but holds sync block 0040c6ec OBJ:014506d0[System.String] STRVAL=SYNC3
CLR thread 
4 is waiting on sync block 0040c6ec.
CLR Thread 
4 is waiting at ConsoleTestApp.ConsoleTestApp.LockReleaseAndExit()+0xc(IL) [C:\dev\ConsoleTestApp\ConsoleTestApp.cs, line 254]

Deadlock detected:
CLR thread 
5 holds sync block 026c1b08 OBJ:7fff0f80[System.String] STRVAL=SYNC1
             waits sync block 026c1b50 OBJ:7fff0fa8[System.String] STRVAL
=SYNC2
CLR thread 
6 holds sync block 026c1b50 OBJ:7fff0fa8[System.String] STRVAL=SYNC2
             waits sync block 026c1b08 OBJ:7fff0f80[System.String] STRVAL
=SYNC1
CLR Thread 
5 is waiting at ConsoleTestApp.ConsoleTestApp.Thread1Proc()+0x4b(IL) [ConsoleTestApp.cs, line 282]
CLR Thread 
6 is waiting at ConsoleTestApp.ConsoleTestApp.Thread2Proc()+0x6c(IL) [ConsoleTestApp.cs, line 319]

2 deadlocks detected.
``

*!dumpgen
Usage: 
!sosex.dumpgen <intGenNum> [-free] [-stat] [-type <TYPE_NAME>]

Dumps the contents of the specified generation 
in the following format:
hexAddr decSize strTypeName

Pass 
3 to dump the large object heap

If 
-free is specified, only FREE object types are included
If 
-stat is specified, only a statistical summary is presented
If 
-type is specified, the output is filtered to only include objects where TYPE_NAME is a substring of the full type name.

Sample output:
0:000>!sosex.dumpgen 1
7fff2310        
216    System.Globalization.NumberFormatInfo
7fff23e8         
28    System.Int32[]
7fff28c8         
74    System.String    STRVAL=NLS_CodePage_437_3_2_0_0
7fff2918         
32    Microsoft.Win32.SafeHandles.SafeViewOfFileHandle
``

*!gcgen
Usage: 
!sosex.gcgen <hexObjectAddr>

Indicates the GC generation 
where the specified object is located
If the 
object is in the LOH, "Large Object Heap" will be indicated
``

*!mbc
Usage: 
!sosex.mbc <Managed Breakpoint ID | *>

Removes the specified breakpoint from the managed breakpoint list. If 
* is specified, removes all managed breakpoints.
``

*!mbd
Usage: 
!sosex.mbd <Managed Breakpoint ID | *>

Disables, but does not remove, the specified breakpoint. If 
* is specified, disables all managed breakpoints.
Any corresponding native breakpoints that have been 
set in support of the specified managed breakpoint will
also be disabled, unless a native breakpoint 
is shared by multiple managed breakpoints.
``

*!mbe
Usage: 
!sosex.mbd <Managed Breakpoint ID | *>

Enables the specified breakpoint. If 
* is specified, enables all managed breakpoints.
Any corresponding native breakpoints that have been 
set in support of the specified managed breakpoint will
also be enabled.
``

*!mbl
Usage: 
!sosex.mbl

Prints a list of all managed breakpoints with status, parameters and corresponding native breakpoint info.

Sample output:
0:000>!sosex.mbl
4 e : tester.cs, line 22: pass=1 oneshot=false thread=ANY
   TestLib
!TestLib.Tester.Test<T1, T2>(T1, T2)+0x3(IL) (PENDING JIT)
      
0 e 002f0cf3: Test<TestStruct, Int32>(TestStruct, Int32)
3 e : *!TESTLIB.TESTER.TEST ILOffset=0: pass=1 oneshot=false thread=ANY
   TestLib
!TestLib.Tester.Test<T1, T2>(T1, T2) (PENDING JIT)
      
1 e 002f0cea: Test<TestStruct, Int32>(TestStruct, Int32)
2 e : *!CONSOLETESTAPP.CONSOLETESTAPP.OVERLOADTEST ILOffset=0: pass=1 oneshot=false thread=ANY
   ConsoleTestApp
!ConsoleTestApp.ConsoleTestApp.OverloadTest(string) (PENDING JIT)
   ConsoleTestApp
!ConsoleTestApp.ConsoleTestApp.OverloadTest(int) (PENDING JIT)
1 eu: consoletestapp.cs, line 170: pass=1 oneshot=false thread=ANY
0 e : *!CONSOLETESTAPP.CONSOLETESTAPP.MAIN ILOffset=0: pass=1 oneshot=false thread=ANY
   ConsoleTestApp
!ConsoleTestApp.ConsoleTestApp.Main(string[]) (PENDING JIT)
      
2 e 003a0212

For each managed breakpoint, there are three levels of information, each of which 
is indicated by the indentation
level: 
03 and 6 characters, respectively.

LEVEL 
1:
As an example of the first level of information, take the following line, indicating a resolved breakpoint:
4 e : tester.cs, line 22: pass=1 oneshot=false thread=ANY

The number 
4 is the managed breakpoint ID.  The e indicates that the breakpoint is enabled.
If the breakpoint were disabled, a d would be displayed instead.  Following the first colon,
either the source
/line/column info or method name is displayed, depending on whether the 
breakpoint 
is a source (!mbp) breakpoint or a method (!mbm) breakpoint.  Following the second
colon are the breakpoint parameters.

Here
's a sample of an unresolved breakpoint:
1 eu: consoletestapp.cs, line 170: pass=1 oneshot=false thread=ANY

The only difference here 
is the presence of the u character, indicating that the breakpoint is
unresolved.  For managed breakpoints, unresolved means that the breakpoint has not yet been 
matched to a method definition 
in any currently-loaded module.


LEVEL 
2:
For resolved breakpoints, the second line 
in the managed breakpoint display, which is indented by 3
characters, indicates information about the method that matched the breakpoint source info or method name.

Example (managed breakpoint 
2):
   ConsoleTestApp
!ConsoleTestApp.ConsoleTestApp.OverloadTest(string) (PENDING JIT)

This indicates the name of the method that matched the input criteria.  There may be more than
one method displayed here under either of the following conditions: 
1) The input to !mbm contained
wildcards that match more than one method, and
/or 2) The input to !mbm specified the name of an
overloaded method.  The PENDING JIT prompt indicates either of two conditions: 
1) The method has
been resolved, but not yet jitted, and
/or 2) The method is a generic method.  Generic methods are
always listed 
as pending JIT because a new instance of the method can be created at any time.


LEVEL 
3:
The third level of information, indented by 
6 characters displays information for any native breakpoints 
that have been 
set in support of the managed breakpoint.

Example (managed breakpoint 
3)
      
1 e 002f0cea: Test<TestStruct, Int32>(TestStruct, Int32)

The 
1 is the debugger ID for the corresponding native breakpoint.  This is the same identifier that 
would be displayed by the bl command.  The e indicates that the native breakpoint 
is enabled.  A d
could also be displayed, indicating that the native breakpoint 
is disabled.  Native breakpoints that
correspond to managed breakpoints can be controlled by the native debugger breakpoint commands, 
such 
as be, bd, bc, etc.  Next, the address of the native breakpoint is listed.  In this particular
example, method signature information 
is displayed.  This is because the method is a generic method.
In 
this case, the signature is necessary in order to distinguish between the different method instances.
For generic methods, multiple native breakpoints may be displayed, indicating all the current instances
of the method.  For non
-generic methods, no method signature is displayed, because it would be redundant.
``

*!mbm
Usage: 
!sosex.mbm <method filter> [ILOffset] [Options]

Sets a breakpoint at the specified method and offset.

Method Filter:
The method filter 
is a wildcard seach string in module!method format.  If module! is not specified, all
modules are searched 
for matching methods.  The method filter is compared against the fully-qualified
name of each method.

IL Offset:
The IL Offset, 
if specified, is a decimal integer value.  This offset determines where in the method
the breakpoint will be 
set.

Options:
/1 - Sets a one-shot breakpoint

/p:n - Sets the pass count for the breakpoint.  This causes the breakpoint to be triggered only when the 
breakpoint has been 
"hit" the specified number of times.  /p:1 causes the breakpoint to be triggered on the
first hit, 
/p:3 causes the breakpoint to be triggered only on the third hit.

/t:n - Causes the breakpoint only to be applied to the specified thread.  "n" is the decimal debugger thread ID.

"command" - Exactly one quoted string parameter may be specified. The contents of this string will be passed on
to corresponding native breakpoints 
as the command parameter.

For further details about these options, see the debugger documentation 
for the 'bp' command.
``

*!mbp
Usage: 
!sosex.mbp <source file> <line number> [column number> [Options]

Sets a breakpoint at the specified source file and line
/column number.

Source File:
The name of the source code file 
in which to set the breakpoint.  Do not specify a full path.

Line number:
The 
decimal number of the line in <source file> at which to set the breakpoint.

Column number:
The 
decimal number of the column of <line number> at which to set the breakpoint.

Options:
/1 - Sets a one-shot breakpoint

/p:n - Sets the pass count for the breakpoint.  This causes the breakpoint to be triggered only when the 
breakpoint has been 
"hit" the specified number of times.  /p:1 causes the breakpoint to be triggered on the
first hit, 
/p:3 causes the breakpoint to be triggered only on the third hit.

/t:n - Causes the breakpoint only to be applied to the specified thread.  "n" is the decimal debugger thread ID.

"command" - Exactly one quoted string parameter may be specified. The contents of this string will be passed on
to corresponding native breakpoints 
as the command parameter.

For further details about these options, see the debugger documentation 
for the 'bp' command.
``

*!mdt
Usage: 
!sosex.mdt [typename | paramname | localname | MT] [ADDR] [-r]

Sample usages:
"!sosex.mdt typeName"  (displays the names of the member fields of the specified type)
"!sosex.mdt argName"   (displays the values of the fields of the specified parameter object-is valid)
"!sosex.mdt localName" (displays the values of the fields of the specified local variable. -is valid)
"!sosex.mdt ADDR"      (displays the values of the fields of the object located at ADDR. -is valid)
"!sosex.mdt MT ADDR"   (displays the values of the fields of the value type specified by MT located at ADDR. -is valid)

Displays the fields of the specified 
object or type, optionally recursively.

If 
-is specified, fields will be displayed recursively down the object graph.  The -switch is ONLY 
applicable 
where an address is used, either by passing an address explicitly or when a param/local name 
that resolves to an address 
is specified.

The scope frame defaults to zero, but may be overridden via the 
!mframe command.  IMPORTANT:  The current
scope frame corresponds to the frames listed by the 
!mk command.

IMPORTANT NOTE: Sosex distinguishes between numeric and non
-numeric strings in order to determine whether an
address or a type
/arg/local name is being passed in ambiguous circumstances.  If you want to pass a string value
that could be interpreted 
as an expression by the debugger, enclose the name in single-quotes.  For example, for
a local named d2, call: 
!mdt 'd2'.  If the name were not quoted in this circumstance, !mdt would attempt to display
an 
object located at address 0xd2.

Frame info 
for the sample output below:
0:000> !mdv
Frame 
0x0: (ConsoleTestApp.ConsoleTestApp.Main(System.String[])):
[A0]:args:
0x2371804 (System.String[])
[L0]:theGuid:{29b9c9c8
-3751-42be-8c7a-8b92ff499588} VALTYPE (MT=6cd46c60, ADDR=002ff1bc) (System.Guid)
[L1]:d2:
0x63718e0 (System.AppDomain)
[L2]:hMod:
0x67280000 (System.Int32)
[L3]:dummy:
0x23721a4 (System.String) STRVAL="This is "THE" way to test!"
[L4]:numThreads:
0x2 (System.Int32)
[L5]:theDate:
2008/01/02 03:04:05.678 VALTYPE (MT=6cd49e98, ADDR=002ff1ac) (System.DateTime)
[L6]:ts1:VALTYPE (MT
=001e3198, ADDR=002ff1a4) (ConsoleTestApp.TestStruct)
[L7]:ft:
0x637544c (ConsoleTestApp.FTEST)
[L8]:g1:
<Retrieval mechanism not implemented. The variable type may be a generic type.>
[L9]:g2:
<Retrieval mechanism not implemented. The variable type may be a generic type.>
[L10]:rnd:
null (System.Random)
[L11]:threads:
null (System.Threading.Thread[])
[L12]:i:
0x0 (System.Int32)
[L13]:ex:
null (System.Exception)
[L14]:CS$
0$0000:VALTYPE (MT=001e3198, ADDR=002ff198) (ConsoleTestApp.TestStruct)
[L15]:CS$
4$0001:0x0 (System.Boolean)


Sample output:
0:000> !mdt theGuid
002ff1bc (System.Guid) {29b9c9c8
-3751-42be-8c7a-8b92ff499588} VALTYPE (MT=6cd46c60, ADDR=002ff1bc)

0:000> !mdt ft
0637544c (ConsoleTestApp.FTEST)
   _s1:
06375460 (System.String: "String 1")
   _s2:
06375484 (System.String: "String 2")
   _arr:063755c4 (System.String[,,], Elements: 
8)

0:000> !mdt 63718e0
063718e0 (System.Runtime.Remoting.Proxies.__TransparentProxy)
   _rp:063718b4 (System.Runtime.Remoting.Proxies.RemotingProxy)
   _stubData:023725dc (BOXED System.IntPtr) VALTYPE (MT
=6cd6b114, ADDR=023725e0)
   _pMT:6cd6902c (System.IntPtr)
   _pInterfaceMT:
00000000 (System.IntPtr)
   _stub:6d601e70 (System.IntPtr)

0:000> !mdt 63718e0 -r
063718e0 (System.Runtime.Remoting.Proxies.__TransparentProxy)
   _rp:063718b4 (System.Runtime.Remoting.Proxies.RemotingProxy)
      _tp:063718e0 (System.Runtime.Remoting.Proxies.__TransparentProxy)
         
<RECURSIVE>
      _identity:
06371698 (System.Runtime.Remoting.Identity)
         _flags:
0x4 (System.Int32)
         _tpOrObject:063718e0 (System.Runtime.Remoting.Proxies.__TransparentProxy)
            
<RECURSIVE>
         _ObjURI:
02376858 (System.String: "/f578dbe2_cf0c_4e30_882b_14126f0b1654/kq_om1xc5idnrbhnqnr77cs0_1.rem")
         _URL:NULL (System.String)
         _objRef:023769e0 (System.Runtime.Remoting.ObjRef)
            uri:
02376858 (System.String: "/f578dbe2_cf0c_4e30_882b_14126f0b1654/kq_om1xc5idnrbhnqnr77cs0_1.rem")
            typeInfo:02376cc4 (System.Runtime.Remoting.TypeInfo)
               serverType:02377ea4 (System.String: 
"System.AppDomain, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
               serverHierarchy:NULL (System.Object[])
               interfacesImplemented:0237808c (System.String[], Elements: 
2)
            envoyInfo:NULL (System.Runtime.Remoting.IEnvoyInfo)
            channelInfo:0237872c (System.Runtime.Remoting.ChannelInfo)
               channelData:
02378738 (System.Object[], Elements: 1)
            objrefFlags:
0x0 (System.Int32)
            srvIdentity:023769fc (System.Runtime.InteropServices.GCHandle) VALTYPE (MT
=6cd6bcb8, ADDR=023769fc)
               m_handle:004e11ec (System.IntPtr)
            domainID:
0x2 (System.Int32)
         _channelSink:
06371890 (System.Runtime.Remoting.Channels.CrossAppDomainSink)
            _xadData:023753c0 (System.Runtime.Remoting.Channels.CrossAppDomainData)
               _ContextID:023753e0 (BOXED System.Int32) BOXEDVAL
=0x69B9B0
               _DomainID:
0x2 (System.Int32)
               _processGuid:023750bc (System.String: 
"81174e11_728a_4211_a674_f6f4d79419ba")
         _envoyChain:063718a8 (System.Runtime.Remoting.Messaging.EnvoyTerminatorSink)
         _dph:NULL (System.Runtime.Remoting.Contexts.DynamicPropertyHolder)
         _lease:NULL (System.Runtime.Remoting.Lifetime.Lease)
      _serverObject:NULL (System.MarshalByRefObject)
      _flags:
0x3 (System.Runtime.Remoting.Proxies.RealProxyFlags)
      _srvIdentity:063718d0 (System.Runtime.InteropServices.GCHandle) VALTYPE (MT
=6cd6bcb8, ADDR=063718d0)
         m_handle:004e11ec (System.IntPtr)
      _optFlags:
0x7000000 (System.Int32)
      _domainID:
0x2 (System.Int32)
      _ccm:NULL (System.Runtime.Remoting.Messaging.ConstructorCallMessage)
      _ctorThread:
0x0 (System.Int32)
   _stubData:023725dc (BOXED System.IntPtr) VALTYPE (MT
=6cd6b114, ADDR=023725e0)
      m_value:ffffffff (System.UIntPtr)
   _pMT:6cd6902c (System.IntPtr)
   _pInterfaceMT:
00000000 (System.IntPtr)
   _stub:6d601e70 (System.IntPtr)

0:000> !mdt args
02371804 (System.String[], Elements: 0)

0:000> !mdt 001e3198 002ff1a4 -r
002ff1a4 (ConsoleTestApp.TestStruct) VALTYPE (MT
=001e3198, ADDR=002ff1a4)
   Member1:
0x4D2 (System.UInt32)
   Member2:
0x162E (System.UInt32)
``

*!mdv
Usage: 
!sosex.mdv [-w]

Displays parameter and local variable information 
for the current frame.  If -is specified, displays 
info 
for all managed frames.

The scope frame defaults to zero, but may be overridden via the 
!mframe command.  IMPORTANT:  The current
scope frame corresponds to the frames listed by the 
!mk command.

Sample output:
0:000> !mdv
Frame 
0x0: (ConsoleTestApp.ConsoleTestApp.Main(System.String[])):
[A0]:args:
0x2371804 (System.String[])
[L0]:theGuid:{29b9c9c8
-3751-42be-8c7a-8b92ff499588} VALTYPE (MT=6cd46c60, ADDR=002ff1bc) (System.Guid)
[L1]:d2:
0x63718e0 (System.AppDomain)
[L2]:hMod:
0x67280000 (System.Int32)
[L3]:dummy:
0x23721a4 (System.String) STRVAL="This is "THE" way to test!"
[L4]:numThreads:
0x2 (System.Int32)
[L5]:theDate:
2008/01/02 03:04:05.678 VALTYPE (MT=6cd49e98, ADDR=002ff1ac) (System.DateTime)
[L6]:ts1:VALTYPE (MT
=001e3198, ADDR=002ff1a4) (ConsoleTestApp.TestStruct)
[L7]:ft:
0x637544c (ConsoleTestApp.FTEST)
[L8]:g1:
<Retrieval mechanism not implemented. The variable type may be a generic type.>
[L9]:g2:
<Retrieval mechanism not implemented. The variable type may be a generic type.>
[L10]:rnd:
null (System.Random)
[L11]:threads:
null (System.Threading.Thread[])
[L12]:i:
0x0 (System.Int32)
[L13]:ex:
null (System.Exception)
[L14]:CS$
0$0000:VALTYPE (MT=001e3198, ADDR=002ff198) (ConsoleTestApp.TestStruct)
[L15]:CS$
4$0001:0x0 (System.Boolean)

= Argument
= Local
``

*!mframe
Usage: 
!sosex.mframe [frame number]

Displays or sets the current managed frame 
for the !mdt and !mdv commands.

If no frame number 
is passed, the current scope frame for !mdt and !mdv is displayed.

If a frame number 
is passed, the current scope frame for !mdt and !mdv is changed.
IMPORTANT:  This frame number must be retrieved by 
using the !mk command, because the 
merged stack trace that 
is displayed by the !mk command (which is different than that 
of 
!sos.clrstack and the 'k' command) is the reference point for scoping !mdt and !mdv.
``

*!mk
Usage: 
!sosex.mk

Produces and displays a merged stack trace of managed and unmanaged frames.

Sample output:
0:009> !mk
00:U 0f2fed78 77c06b65 ntdll!NtWaitForMultipleObjects+0x15
01:U 0f2fed80 761e2091 KERNELBASE!WaitForMultipleObjectsEx+0x100
02:U 0f2fee1c 77267e91 KERNEL32!WaitForMultipleObjectsExStub+0xe0
03:U 0f2fee64 6d6f4a6a mscorwks!WaitForMultipleObjectsEx_SO_TOLERANT+0x6f
04:U 0f2feecc 6d6f469b mscorwks!Thread::DoAppropriateAptStateWait+0x3c
05:U 0f2feeec 6d6f47a4 mscorwks!Thread::DoAppropriateWaitWorker+0x13c
06:U 0f2fef70 6d6f4839 mscorwks!Thread::DoAppropriateWait+0x40
07:U 0f2fefc0 6d6f49b9 mscorwks!CLREvent::WaitEx+0xf7
08:U 0f2ff01c 6d61c54e mscorwks!CLREvent::Wait+0x17
09:U 0f2ff030 6d7386ba mscorwks!AwareLock::EnterEpilog+0x8c
0a:U 0f2ff0bc 6d63e3cc mscorwks
!AwareLock::Enter+0x61
0b:U 0f2ff0d8 6d63e350 mscorwks
!JIT_MonEnterWorker_Portable+0xb3
0c:M 0f2ff178 005007c1 ConsoleTestApp.ConsoleTestApp.LockReleaseAndExit()(
+0xc IL)(+0x18 Native) [C:\dev\ConsoleTestApp\ConsoleTestApp.cs, @ 293,13]
0d:M 0f2ff180 6cd16e36 System.Threading.ThreadHelper.ThreadStart_Context(System.Object)(
+0x14 IL)(+0x60 Native)
0e:M 0f2ff18c 6cd202bf System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)(
+0x58 IL)(+0x65 Native)
0f:M 0f2ff1a0 6cd16db4 System.Threading.ThreadHelper.ThreadStart()(
+0x8 IL)(+0x2a Native)
10:U 0f2ff1b8 6d601b4c mscorwks!CallDescrWorker+0x33
11:U 0f2ff1c8 6d6121b9 mscorwks!CallDescrWorkerWithHandler+0xa3
12:U 0f2ff248 6d626531 mscorwks!MethodDesc::CallDescr+0x19c
13:U 0f2ff380 6d626564 mscorwks!MethodDesc::CallTargetWorker+0x1f
14:U 0f2ff39c 6d626582 mscorwks!MethodDescCallSite::Call+0x1a
15:U 0f2ff3b4 6d6e59e3 mscorwks!ThreadNative::KickOffThread_Worker+0x192
16:U 0f2ff59c 6d62848f mscorwks!Thread::DoADCallBack+0x32a
17:U 0f2ff5b0 6d62842b mscorwks!Thread::ShouldChangeAbortToUnload+0xe3
18:U 0f2ff644 6d628351 mscorwks!Thread::ShouldChangeAbortToUnload+0x30a
19:U 0f2ff680 6d6284dd mscorwks!Thread::ShouldChangeAbortToUnload+0x33e
1a:U 0f2ff6a8 6d6e57b4 mscorwks
!ManagedThreadBase::KickOff+0x13
1b:U 0f2ff6c0 6d6e588e mscorwks
!ThreadNative::KickOffThread+0x269
1c:U 0f2ff75c 6d71d5bd mscorwks
!Thread::intermediateThreadProc+0x49
1d:U 0f2ff8fc 7726816c KERNEL32
!BaseThreadInitThunk+0xe
1e:U 0f2ff908 77c42404 ntdll
!__RtlUserThreadStart+0x23
1f:U 0f2ff948 77c42618 ntdll
!_RtlUserThreadStart+0x1b

For the explanation, we will use the following line:
0c:M 0f2ff178 005007c1 ConsoleTestApp.ConsoleTestApp.LockReleaseAndExit()(
+0xc IL)(+0x18 Native) [C:\dev\ConsoleTestApp\ConsoleTestApp.cs, @ 293,13]

0c 
is the frame number.
M indicates that the frame 
is a managed frame.  Unmanaged frames are indicated with a U.
The first address 
is the ESP value for the frame.
The second address 
is the EIP value for the frame.
Following the addresses 
is the name of the method.
Following the method name 
is the IL and/or native offset within the method
Following the offset info 
is the source code information, if available.
``

*!mln
Usage 
!sosex.mln <address expression>

Displays the type of CLR data residing at the given address, 
if it can be determined.

Sample output:
0:011> !mln 6cd16db4
Method instance: 6cd16d70[System.Threading.ThreadHelper.ThreadStart()]

0:011> !mln 0f85ec88 
Stack: debugger thread 
11, frame 5
``

*!mx
Usage: 
!sosex.mx <Filter String>

Displays any matching type, method or field 
for <Filter String>where <Filter String> is a string in 
module
!metadataname format.  If module! is not specified, all modules are searched for the specified 
metadata.  Searched info includes types, methods and fields.

Sample output:
0:011> !mx consoletestapp.*struct*
ConsoleTestApp
!ConsoleTestApp.TestStruct
ConsoleTestApp
!ConsoleTestApp.TestStruct.Member1
ConsoleTestApp
!ConsoleTestApp.TestStruct.Member2
ConsoleTestApp
!ConsoleTestApp.TestStruct1
ConsoleTestApp
!ConsoleTestApp.TestStruct1..ctor(): void
ConsoleTestApp
!ConsoleTestApp.TestStruct1..cctor(): void
ConsoleTestApp
!ConsoleTestApp.TestStruct1.__sf1
ConsoleTestApp
!ConsoleTestApp.TestStruct1.Member1
ConsoleTestApp
!ConsoleTestApp.TestStruct1.Member2
ConsoleTestApp
!ConsoleTestApp.TestStruct2
ConsoleTestApp
!ConsoleTestApp.TestStruct2..ctor(): void
ConsoleTestApp
!ConsoleTestApp.TestStruct2..cctor(): void
ConsoleTestApp
!ConsoleTestApp.TestStruct2.__sf2
``

*!refs
Usage:
!sosex.refs <hexObjectAddr>

Lists all references held by the specified 
object
Lists all references to the specified 
object (searches heaps, stacks, registers, handle tables and the freachable queue)

Refs are listed 
in the following format:
hexAddr decSize strTypeName

Sample output:
0:000> !sosex.refs 7fff2970
Objects referenced by 7fff2970:
7fff1100         
64    System.IO.__ConsoleStream
7fff1388        
136    System.Text.SBCSCodePageEncoding
7fff2c50         
48    System.Text.DecoderNLS
7fff2c80        
280    System.Byte[]
7fff2d98        
536    System.Char[]
7fff1140         
24    System.Byte[]

Objects referencing 7fff2970:
7fff2fb0         
32    System.IO.TextReader+SyncTextReader
``

*!strings
Lists all strings on managed heaps that match the specified criteria.
Usage: 
!sosex.strings [Options]

Options:
g:
<min gen>       Lists strings only in the specified or higher GC generation.  Valid parameters are 012 and 3 (Large Object Heap).
m:
<match filter>  Limits output to strings matching the specified filter string.  Filter may contain * and ? wildcards.
n:
<min length>    Limits output to strings whose length is greater than or equal to the specified decimal integer.
x:
<max length>    Limits output to strings whose length is less than or equal to the specified decimal integer.

Sample output:
0:000> !sosex.strings /g:2 /n:3
Address    Gen  Value
---------------------------
05cce580    
2    yactpju7foti0zzva_6exij1_3.rem
05cce818    
2    System.Runtime.Remoting.ObjectHandle, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
05ccebf0    
2    System.Runtime.Remoting.IObjectHandle
05ccec4c    
2    System.Runtime.Remoting.IObjectHandle, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
05ccf230    
2    /dd626c52_630c_4206_833d_ffd9ac214b3e/yactpju7foti0zzva_6exij1_3.rem
05ccf2cc    
2    dd626c52_630c_4206_833d_ffd9ac214b3e/yactpju7foti0zzva_6exij1_3.rem
05ccfb10    
2    TestLib.Tester.InstanceTest called.
05ccfbc0    
2    111
05ccfbd8    
2    123

---------------------------------------
394 strings
``

 

Tag标签: widnbg,sosex
0
0
(请您对文章做出评价)
« 上一篇:[Shit算法]XmlFormat
» 下一篇:[算法]你瓦我玉:indexof
posted @ 2009-11-24 13:05 overred 阅读(210) 评论(0)  编辑 收藏 所属分类: ① NET Framework