SOSEX Extension Commands in VS .NET

Drawer Quick Response Code in VS .NET SOSEX Extension Commands
SOSEX Extension Commands
Encoding QR Code In .NET
Using Barcode generator for VS .NET Control to generate, create Quick Response Code image in .NET applications.
(17981ba8): CLR notification exception - code e0444143 (first chance) Breakpoint: Matching method AdvancedNETDebugging3SimpleMain resolved, but not yet jitted Setting JIT notification ModLoad: 79060000 790b6000 C:\Windows\MicrosoftNET\Framework\v2050727 \mscorjitdll (17981ba8): CLR notification exception - code e0444143 (first chance) Breakpoint: JIT notification received for method AdvancedNETDebugging3SimpleMain(SystemString[]) Breakpoint set at AdvancedNETDebugging 3SimpleMain(SystemString[]) Breakpoint 0 hit eax=00113020 ebx=0024eddc ecx=01cd5890 edx=00000005 esi=004a5148 edi=00000000 eip=00380084 esp=0024eda4 ebp=0024edc0 iopl=0 nv up ei pl zr na pe nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246 00380084 90 nop 0:000> loadby sosdll mscorwks 0:000> !ClrStack OS Thread Id: 0x1da8 (0) ESP EIP 002af174 002c0084 AdvancedNETDebugging3 SimpleMain(SystemString[]) 002af3a4 79e7c74b [GCFrame: 002af3a4] 0:000>
QR Code JIS X 0510 Scanner In VS .NET
Using Barcode scanner for Visual Studio .NET Control to read, scan read, scan image in .NET framework applications.
After the SOSEX extension DLL is loaded, we use the mpm extension command to set a breakpoint on the Main method in the AdvancedNETDebugging 3Simple type at offset 0 When we resumed execution, a breakpoint was hit, and using the SOS ClrStack extension command we can see that execution stopped at the beginning of the Main method The mbm command also gives you a few configurable options
Barcode Creation In Visual Studio .NET
Using Barcode encoder for .NET framework Control to generate, create bar code image in VS .NET applications.
!mbm <strTypeAndMethodFilter> <intILOffset> [Options]
Scanning Barcode In .NET
Using Barcode scanner for Visual Studio .NET Control to read, scan read, scan image in Visual Studio .NET applications.
where the Options switch can be one of the following:
Generating QR In Visual C#
Using Barcode encoder for VS .NET Control to generate, create QR image in Visual Studio .NET applications.
3 BASIC DEBUGGING TASKS
Draw Quick Response Code In .NET Framework
Using Barcode generator for ASP.NET Control to generate, create QR Code 2d barcode image in ASP.NET applications.
/1 Only trigger this breakpoint once /p:<passcount> Indicates which iteration of the breakpoint should result in
QR-Code Maker In VB.NET
Using Barcode printer for .NET Control to generate, create QR image in VS .NET applications.
execution stopping /t: <threadid> Breakpoint is only triggered when a thread with the specified thread ID hits the breakpoint
ECC200 Encoder In Visual Studio .NET
Using Barcode printer for VS .NET Control to generate, create Data Matrix 2d barcode image in .NET applications.
The mbm command also supports wild cards in the strTypeAndMethodFilter
Code 128 Code Set B Drawer In .NET Framework
Using Barcode creation for VS .NET Control to generate, create Code 128A image in VS .NET applications.
3
GS1 - 12 Generator In .NET
Using Barcode generator for VS .NET Control to generate, create UPC A image in .NET framework applications.
Basic Debugging Tasks
USS Code 39 Maker In .NET
Using Barcode drawer for .NET framework Control to generate, create Code-39 image in .NET framework applications.
Both of the breakpoint extension commands that SOSEX offers are very useful and make life a lot simpler when setting breakpoints at the source code level
Royal Mail Barcode Printer In VS .NET
Using Barcode creator for Visual Studio .NET Control to generate, create British Royal Mail 4-State Customer Barcode image in .NET framework applications.
Managed Metadata
Creating Barcode In .NET
Using Barcode creator for ASP.NET Control to generate, create bar code image in ASP.NET applications.
To effectively debug NET applications using the native debuggers, we need to be able to quickly find metadata such as type names and method names To facilitate this requirement, the mx command can be used and has the general syntax
Decode GTIN - 13 In .NET Framework
Using Barcode recognizer for .NET framework Control to read, scan read, scan image in .NET framework applications.
!mx <Filter String>
Make Data Matrix ECC200 In C#
Using Barcode generation for .NET framework Control to generate, create Data Matrix 2d barcode image in Visual Studio .NET applications.
where the Filter String argument represents a wild card search string for the metadata of interest For example, if we ran 03simpleexe under the debugger and want to find out all the methods available on the Simple type, we can run the following command:
Make Code 128 Code Set A In Visual C#.NET
Using Barcode drawer for Visual Studio .NET Control to generate, create Code 128 Code Set C image in Visual Studio .NET applications.
0:000> !mx 03simple!*Simple* 03Simple!AdvancedNETDebugging3Simple 03Simple!AdvancedNETDebugging3Simple AdvancedNETDebugging3SimpleMain(SystemString[]) 03Simple!AdvancedNETDebugging3Simple AdvancedNETDebugging3Simplector()
Printing Barcode In .NET
Using Barcode printer for ASP.NET Control to generate, create bar code image in ASP.NET applications.
Another command that is very useful is the mln command, which takes an address and identifies the managed code related content of that address At this point, it accurately identifies JIT compiled code, heap, and stack objects For example, let s say we have an address X and we want to know what that address represents (from the CLR s perspective) We could employ a number of manual techniques by using the various commands such as DumpObj (to see if it s an object) or U to unassemble the address to see if it contains code It would be far easier if we had an automated way of identifying the content of the address For example, if while debugging 03ObjTypesexe we were presented with the address 0x01eb6d64, we could run the mln command on that address to identify the contents of that address:
GTIN - 12 Encoder In Java
Using Barcode creator for Java Control to generate, create UPC-A image in Java applications.
0:000> !mln 0x01eb6d64 Heap Object: 01eb6d64[AdvancedNETDebugging3ObjTypes]
Code 128C Creator In VB.NET
Using Barcode maker for .NET framework Control to generate, create Code 128 Code Set B image in .NET framework applications.
As we can see, the address 0x01eb6d64 corresponds to a managed heap object of type AdvancedNETDebugging3ObjTypes
Code 39 Extended Creator In Visual Studio .NET
Using Barcode generation for ASP.NET Control to generate, create Code 3/9 image in ASP.NET applications.
SOSEX Extension Commands
Stack Traces
So far, we have seen different ways of displaying the call stack for a managed code thread We utilized the native debugger kb command, which displays the raw native code call stack (not terribly useful for managed code debugging) as well as the ClrStack command, which displays the managed code call stack When it is desirable to display a combination of managed code and native code call stacks, the SOSEX mk command can be used In addition to displaying both managed code and native code frames, it displays the frame number The following is an example of the output of mk when run while breaking into the debugger of the 03simpleexe application:
0:000> !mk *** WARNING: Unable to verify checksum for C:\Windows\assembly\NativeImages_v2050727_32\mscorlib \5b3e3b0551bcaa722c27dbb089c431e4\mscorlibnidll 00:U 0028ea68 778e8d94 ntdll!KiFastSystemCallRet+0x0 01:U 0028ea6c 778f9522 ntdll!NtRequestWaitReplyPort+0xc 02:U 0028ea8c 777a7e05 ntdll!CsrClientCallServer+0xc2 03:U 0028eb78 777a7f35 KERNEL32!GetConsoleInput+0xd2 04:U 0028eb98 003aa61c KERNEL32!ReadConsoleInputA+0x1a 05:U 0028ec20 793e8f28 0x003aa61c 06:M 0028ec88 793e8e33 mscorlib!SystemConsole ReadKey(Boolean)(+0x50 IL)(+0x6d Native) 07:M 0028ecb0 79e7c6cc mscorlib!SystemConsole ReadKey()(+0x0 IL)(+0x7 Native) 08:M 0028ecb0 79e7c6cc 03Simple!AdvancedNETDebugging3SimpleMain(SystemString[])(+0x17 IL)(+0x22 Native) [c:\Publishing\ADND\Code\3\Simple\03simplecs, @ 12,13] 09:U 0028ed30 79e7c8e1 mscorwks!CallDescrWorkerWithHandler+0xa3 0a:U 0028ee74 79e7c783 mscorwks!MethodDesc::CallDescr+0x19c 0b:U 0028ee90 79e7c90d mscorwks!MethodDesc::CallTargetWorker+0x1f 0c:U 0028eea4 79eefb9e mscorwks!MethodDescCallSite::Call+0x18 0d:U 0028f008 79eef830 mscorwks!ClassLoader::RunMain+0x263 0e:U 0028f270 79ef01da mscorwks!Assembly::ExecuteMainMethod+0xa6 0f:U 0028f740 79fb9793 mscorwks!SystemDomain::ExecuteMainMethod+0x43f 10:U 0028f790 79fb96df mscorwks!ExecuteEXE+0x59 11:U 0028f7d8 7900b1b3 mscorwks!_CorExeMain+0x15c 12:U 0028f7e8 77744911 mscoree!_CorExeMain+0x2c 13:U 0028f7f4 778ce4b6 KERNEL32!BaseThreadInitThunk+0xe 14:U 0028f834 778ce489 ntdll!__RtlUserThreadStart+0x23 15:U 0028f84c 00000000 ntdll!_RtlUserThreadStart+0x1b