TonySchr's Frequently Used Debugger Commands

Debugging

g

gh, gn

Go; exception handled, not handled

r   Registers
k kv, kp, kP, kn [NumFrames] Dump stack; FPO info; params; param (formatted); frame #’s
u [Range] Unassemble code

t, p

tb, pc

Step Into, Step Over; trace to branch, step to next function call

dv

 

Display local variables

dt

Address [Type] [Options]

Dump type; Options=[-b display substructures | -r[depth] full recursive]

dds

[Range]

Display words and symbols (dump raw stack or address table)

d

d[ b | w | d | u | a | s | S]

Display memory; byte | word | dword | Unicode chars | ASCII string | unicode string

e

e[ b | d | D | f | p | a | u ]

Edit memory; byte | dword | double | float | pointer | ascii | unicode

ln

 

List nearest symbol

lm lm[ l | v | k | u | f ] List modules; with loaded symbols | verbose | kernel only | user only | image path

bp

Address

Set breakpoint

ba

Access Size Address

Set memory breakpoint.  Access=[e|r|w], Size=[1|2|4]

bl

 

List breakpoints

bc

be, bc ID

Breakpoint clear; enable; disable

wt

 

Trace and Watch function (see functions being called)

sx

 

Set exception params

~

~[Command]
~*Command
~*e [cmd]
~N
s

List threads; prefix for thread commands
Run command for all threads (works for a few common commands such as k, r)
Run command for all threads
Switch to thread N

|

 

Current process

.cxr

[Address]

Display or set context record

.exr

Address

Display exception record

.lastevent

 

What happened - shows most recent exception

.frame

[FrameNumber]

Set local context (e.g. for dv)

? ?? [Expression] Evaluate expression; evaluate C++ expression

Extensions

!analyze -v Display information about the current exception; verbose
!handle [Handle] Show handle information
!critsec Address Show critical section information
!runaway   Show time per thread
!teb   !peb   Thread environement, Process environment
!gle   Shows GetLastError() result for current thread
!error Error code Look up error code

Misc Meta-commands

.sympath

=, +

Display and set/append symbol path

.symfix

 

Set search path to online symbol server: SRV**http://msdl.microsoft.com/download/symbols

.reload

[Module]

Reload symbols

.lines

 

Toggle source lines in stack trace

.srcpath

Path

Sets path for source debugging

.dump [/ma | /m] Filename Create crashdump file, full or mini
.shell [Command] Execute remote command or drop to simple remote shell

Remote Debugging

Debugee (server)

Debugger (client)

.remote pipename

remote.exe /C servername pipename

cdb -d process

(to pipe through kd)

/debug /debugport=COM1 /baudrate=115200

remote.exe /S “kd -k com:port=com2,baud=115200” tonydev