How to use WinDBG to debug

How to use WinDBG to debug
 
Collecting Memory Dump
 
The easiest way to collect memory dump is to use adplus.vbs script.
This script can be used to collect hanging/crashing memory dump, but most of the time you will be looking at the hang.
 
While the process is running, run the following command:
 
c:/debuggers>adplus -hang -pn <ProcessName> -o <OutputDir>
 
For example, to collect memory dump for PubSub would be
 
c:/debuggers>adplus -hang -pn PubSubJob.exe -o e:/
 
For IIS, you can do one of the two following ways:
 
c:/debuggers>adplus -hang -iis -o e:/
c:/debuggers>adplus -hang -pn w3wp.exe -o e:/
 
Both of them would take a memory dump of IIS, but the first one would also include a few other related processes.
 
In the case of managed code, most of the necessary information is already embedded in the meta data, so you don't need to worry about symbols much.
 
Windbg and SOS
 
windbg is originally written for debugging native code. In order to support managed code, you will need to include SOS (Son of Strike). There is a private version of SOS is available on toolbox called Psscor ( http://toolbox/22153). You will need to load 32bit or 64bit version depending on where the memory dump is taken.
 
To start analyzing the memory dump, open windbg, and go File -> Open Crash Dump and specify the .dmp file.
 
Once the memory dump is loaded, wait until the initial processing is done.
 
When everything is loaded, you can now load the SOS by typing
 
> .load <path>
 
For example,
 
 
After the SOS is loaded, you are ready to perform analysis.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值