WinDbg / SOS

Starting, Attaching, Executing and Exiting

 

Start -> All Programs -> Debugging Tools for Windows -> WinDbg

F6

attach to process

Ctrl-Break

interrupt debugee

.detach

detach from a process

g

continue debugee execution

q

exit WinDbg

 

Getting Help

?

help on commands that affect the debugee

.help

help on commands that affect the debugger

.hh command

view the on line help file

!help

help on the extension dll at the top of the chain (e. g., SOS)

 

Issuing Commands

up arrow, down arrow, enter

scroll through command history

Right mouse button

paste into command window

 

Examining the Unmanaged Environment

lmf

list loaded modules with full path

lmt

list loaded modules with last modified timestamp

~

list unmanaged threads

~thread s

select a thread for thread specific commands

!token -n

view thread permissions

k

view the unmanaged call stack

!runaway

view thread CPU consumption

bp

set a breakpoint

.dump path

dump small memory image

.dump /ma path

dump complete memory image

 

Working with Extension DLLs (e. g., SOS)

.chain

list extensions dlls

.load clr10/sos

load SOS for debugging framework 1.0 / 1.1

.unload clr10/sos

unload SOS

.loadby sos mscorwks

load SOS for debugging framework 2.0

 

SOS Commands

!threads

view managed threads

!clrstack

view the managed call stack

!dumpstack

view combined unmanaged & managed call stack

!clrstack -p

view function call arguments

!clrstack –l

view stack (local) variables

!name2ee module class

view addresses associated with a class or method

!dumpmt –md address

view the method table & methods for a class

!dumpmd address

view detailed information about a method

!do address

view information about an object

!dumpheap –stat

view memory consumption by type

!dumpheap –min size

view memory consumption by object when at least size

!dumpheap –type type

view memory consumption for all objects of type type

!gcroot address

view which object are holding a reference to address

!syncblk

view information about managed locks

 

SOS 2.0 Commands

!bpmd module method

set breakpoint

!DumpArray address

view contents of an array

!PrintException

view information about most recent exception

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值