Team LiB
Previous Section Next Section

Debugging with Cordbg

Cordbg is the .NET Framework Runtime Debugger. Table 16-3 lists the Cordbg commands, and Table 16-4 lists the mode arguments. Cordbg can be started from the Visual Studio command prompt.

Table 16-3: Cordbg Commands

Name

Description

show

Shows source code lines before and after the current line of execution (the command with the asterisk will be the current command)

print

Shows the local variables values

next [count]

Steps to the next line of code, skipping over method calls; count is the number of code lines to skip

so [count]

Same as next

step [count]

Steps through the lines of code entering into any method calls

si [count]

Same as step

in [count]

Same as step

nsingle [count]

Steps through the code, skipping method calls

ssingle [count]

Steps through code, stepping into method calls

out [count]

Steps out of the current method

se

Sets the next line of code to execute

disassemble

Shows disassembly information

registers

Shows registers

dump

Dumps a memory address

break

Sets a breakpoint (break module!class::method)

remove

Removes a breakpoint

go

Starts execution

kill

Shuts down an application

<

Reads a batch file (< Mybatch.txt)

>

Writes to a file

Table 16-4: CORDBG Mode Arguments

Name

Description

appDomainLoads

Displays application domain and assembly load information

classLoads

Displays class load events

dumpMemoryInBytes

Displays memory as bytes or DWORDs

enhanceDiag

Displays enhanced diagnostic information

hexDisplay

Displays numbers in hex or decimal format

ilNatPrint

Displays offsets in MSIL offsets or native format

iSAll

Steps through all interceptors

iSClinit

Steps through class initializers

iSExceptF

Steps through exception filters

iSInt

Steps through user interceptors

iSPolicy

Steps through context policies

iSSec

Steps through security interceptors

jitOptimizations

Specifies if JIT creates easy-to-debug code

loggingMessages

Displays managed code log messages

moduleLoads

Displays module load events

separateConsole

Specifies if the process being debugged gets its own console

showArgs

Displays method arguments in a stack trace

showModules

Displays module names in a stack trace

showStaticsOnPrint

Displays static fields for objects

showSuperClassOnPrint

Displays contents of base classes on print

uSAll

Steps through unmapped stop locations

uSEpi

Steps through method epilogues

uSPro

Steps through method prologues

uSUnmanaged

Steps through unmanaged code


Team LiB
Previous Section Next Section