WinDbg / SOS Cheat Sheet

好东西,要留下记录,尽量全部装进我的大脑。哈哈!

原文地址:
http://kentb.blogspot.com/2007/11/windbg-sos-cheat-sheet.html

rel="File-List" href="file:///C:%5CDOCUME%7E1%5CDENGSH%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"> rel="themeData" href="file:///C:%5CDOCUME%7E1%5CDENGSH%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"> rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CDENGSH%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml">

WinDbg / SOS Cheat Sheet


Environment

Attach to process

F6

Detach from a process

.detach

Break debugger execution

Ctrl-Break

Continue debugger execution

g

Exit WinDbg

q

Clear the screen

.cls

 

Getting Help

Debugger commands

?

Debugger commands

.help

Online help file

.hh command

Help on extension on top of chain

!help

Help on specific extension command

!help command

 

Issuing Commands

Scroll through command history

[up], [down], [enter]

Paste into command window

[right-click]

 

Examining the Unmanaged Environment

List loaded modules with full path

lmf

List loaded modules with last modified timestamp

lmt

List unmanaged threads

~

Select active thread

~thread_id s

View call stack

k

View thread CPU consumption

!runaway

Set a breakpoint

bp

Dump small memory image

.dump path

Dump large memory image

.dump /ma path

 

Loading SOS

Load SOS for .NET 1.x

.load clr10/sos

Load SOS for .NET 2.0

.loadby sos mscorwks

 

Examining the Managed Environment

Dump runtime type information

!dumpruntimetypes

View managed threads

!threads

View managed call stack

!clrstack

View combined managed / unmanaged callstack

!dumpstack

View function call arguments

!clrstack –p

View local variables

!clrstack –l

View object dump

!do address

View array dump

!da address

View object size (including children)

!objsize address

View heap usage by type

!dumpheap -stat

View heap usage filtered by type

!dumpheap -type type

View GC roots of object instance

!gcroot address

View managed sync blocks

!syncblk

View managed thinlocks (CLR 2.0)

!dumpheap –thinlock

View information on most recent exception

!printexception

Set a breakpoint

!bpmd module method

 


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值