windbg 常用命令~*
32bit和64bit切換:!wow64exts.sw
查看進程運行的時間:vertarget
查看依賴的動態庫(包含dll的路徑):lmf
查看pdb文件:lm
查看所有的線程堆棧:~*kbn
切換線程:~20s
切換線程上的棧信息:.frame x (x代表的堆棧)
輸出信息到日志:.logopen c:text.log &&.logclose
自動分析:!analyze -v
查看所有線程的優先級:~* (Priority)
顯示鎖信息:!lcoks
列出CriticalSection的詳細信息:!cs
保存dmp信息:.dump /ma C:\dumps\myapp.dmp
查看某個handle的具體信息:!handle xxx f
設置遠程symbol位置:SRV*D:\SymbolLocal*http://msdl.microsoft.com/download/symbols
重新加載所有的符號表:.reload /f
每個線程消費的時間:!runaway???0x1(0x1代表的是線程消耗的用戶模式時間,0x2代表消耗的內核時間,0x4每個線程從插件經歷了多少時間)
顯示當前作用域的所有局部變量的名字和值:dv
查看內存地址上的數據:db?xxx (字節值和ASCII字符)
!heap相關介紹:
| -v | Causes the debugger to validate the specified heap. |
| -a | Causes the display to include all information for the specifiedheap. Size, in this case, is rounded up to theheap granularity. (Running!heap with the-a option is equivalent to running it with the three options-h -f -m, which can take a long time.) |
| -h | Causes the display to include all entries for the specifiedheap. |
| -f | Causes the display to include all the free list entries for the specifiedheap. |
| -m | Causes the display to include all the segment entries for the specifiedheap. |
| -t | Causes the display to include the tag information for the specifiedheap. |
| -T | Causes the display to include the pseudo-tag entries for the specifiedheap. |
| -g | Causes the display to include the global tag information. Global tags are associated with each untagged allocation. |
| -s | Causes the display to include summary information for the specifiedheap. |
| -k | (x86-based targets only) Causes the display to include the stack backtrace associated with each entry. |
!heap -s 查看地址上的堆信息
!heap -stat -h 04920000 去觀察這段內存(04920000)的詳細情況,可以看到這地址上的內存分布
!heap -flt s 4 去查進程中size=4的所有內存
!heap -p -a 0365e8f0查看堆上的調用堆棧
u 相關介紹
如果要反匯編某一個地址,直接用u命令加地址,如果存在符號文件,也可以這樣直接加函數名。
ub 指示要反匯編的區域是向后計算的,如果使用了ubAddress ,反匯編區域是以Address結束的8或9條指令。如果用ubAddressLLength語法指定區域,則反匯編以Address結尾的指定長度的內容。??
uf 命令顯示內存中指定函數的反匯編代碼。
?
總結
以上是生活随笔為你收集整理的windbg 常用命令~*的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: js实现日期转换方法
- 下一篇: 筛选出1-n之间的个位数字为1的素数(J