0:000> !netext.whelp
netext version 2.0.0.5000 Feb 9 2015
License and usage can be seen here: !whelp license
Check Latest version: !wupdate
For help, type !whelp (or in WinDBG run: '.browse !whelp')
Questions and Feedback: http://netext.codeplex.com/discussions
Copyright (c) 2014-2015 Rodney Viana (http://blogs.msdn.com/b/rodneyviana)
Type: !windex -tree or ~*e!wstack to get started
Show Object Detail Commands
!wdo - Display ad-hoc objects or arrays from GAC or Stack
!wselect - Display ad-hoc fields (and level fields) for an object or for all item in an array
!wfrom - Perform SQL-like analysis of Heap objects enabling comparison, expression evaluation and indexed filtering.
*(new)* !wpe - Dump Exception Object
Enumerate objects
!windex - index and display objects based in different filters like object with of type HttpContext
!wstack - dump unique stack objects
!wheap - list objects without indexing and show thottled heap sampling
!wgchandle - Dump GC root handles
*(new)* !wdae - Dump All Exceptions
Process commands
!wclrstack - Dump current stack trace (only managed thread)
*(new)* !wthreads
*(new)* !wver - Show CLR version and extension version
*(new)* !wupdate - Check for update
Special
!wdict - Display dictionary objects
!whash - Display HashTable objects
!whttp - List HttpContext Objects
!wconfig - Show all .config file lines in memory
!wservice - List WCF service Objects
!weval - Evaluate expression list
!wkeyvalue - Display pair key/value for NameObjectCollection type objects
!wcookie - Display HTTP cookies
!wruntime - Display HTTP Runtime Info including Active Requests
!wtoken - Display WIF tokens and cookies
Misc
expression syntax
functions list *new functions*
license see all licenses applied to this product
0:000> !netext.whelp wdo
Display ad-hoc objects or arrays from GAC or Stack
Usage: !wdo [-forcearray] [-shownull] [-noheader] [-noindex] [-tokens] [-mt ]
[-start ] [-end ]
Where:
-mt is the method table address of the object (for value objects). Optional
-start lt;expr> is the starting index of an array. Optional. Default is starting array at item 0
-end is the end index of an array. Optional. Default is ending array at max items
-forcearray if not used Byte[] and Char[] arrays will show as string instead of array items. Optional
-shownull if not used will show only non-empty array items. Optional
-noheader if present will hide headers and show only object address, fields and values. Optional
-noindex if present will not show array index (useful for .foreach). Optional
-tokens if present will show class token and field token is the object or array address (you can use an expression). Required
Improvements over !DumpObj:
- Object, struct and nested class fields show address value with link to detail the field. Click link to follow
- Numeric type fields show both hex and decimal values
- For Enum type fields it shows the type name (or type names for \[Flag\]Enum) along with the numeric value
- For TimeSpan and DateTime fields it shows the string equivalent
- For strings it show the content after the address
- It shows the inheritance chain in the header (not interface implementations though)
- Byte\[\] and Char\[\] objects shows as string if you do not use -forcearraty
- By default, array objects only show non-null items
- Static fields show the value for the first valid application domain where it is defined
- For arrays it lists all components
!wdo -start 5 -end a 000000016d29cb50
Address: 000000016d29cb50
EEClass: 00000642780e0cf8
Method Table: 000006427843e2a8
Class Name: System.Collections.Hashtable+bucket\[\]
Size : 576
Rank: 1
Components: 23
\[5\]: 000000016d29cbd8
\[6\]: 000000016d29cbf0
\[7\]: 000000016d29cc08
\[8\]: 000000016d29cc20
\[9\]: 000000016d29cc38
\[10\]: 000000016d29cc50
\* Note: for HashTables you can use !whash
Compare to:
!wselect - also shows add-hoc objects and arrays, however wselect enables the selection of fields (and field levels) and does not show extensive header
!wfrom - enable complex query mechanism with categories, conditions and functions but it is not as simple to use as wselect and wdo
How do I get object addresses?
- Type !windex -enumtypes or !windex -tree to enumerate heap objects
- Type ~\*e!wstack to list all objects in the stack for all threads
- Type !wheap to show a quick heap sampling without indexing. It will yield a throttled but quick output
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:
This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example:
C#
class Test
{
static void Main()
{
ServiceClient client = new ServiceClient();
// Use the 'client' variable to call operations on the service.
// Always close the client.
client.Close();
}
}
Visual Basic
Class Test
Shared Sub Main()
Dim client As ServiceClient = New ServiceClient()
' Use the 'client' variable to call operations on the service.
' Always close the client.
client.Close()
End Sub
End Class
例如, 如果我现在知道HttpContext的地址. 然后我需要知道它对应的请求的UTC Time Stamp, http Method, URL, Response status code等等内容时, 应该怎么办? 这些数据并不全都直接显示在HttpContext上面. UTC Time Stamp在HttpContext上面可以找到. HttpMethod则在HttpContext下面的HttpRequest下面this._request._httpMethod. URI则离得更远, _request._url.m_String. Response Status Code又在另外一个对象上this._response._statusCode. 下面举例我如何通过SOS去DUMP一个Http的请求地址.