一些有关于Windbg和Windows调试的乱七八糟的东西。

      序,这篇blog的由来。

曾经有很多次,看到些有用的小知识,自以为很简单记下来了,可是等到用的时候却想不起来了。只知道有这么一回事,但是连一个关键字都无法回忆起去google.往往浪费了大量的时间去查找。
今天又看到一点东西,估计明天就会忘记。索性都乱七八糟的记下来。

---------------------------分割,又见分割线---------------------------------------------
也许有人也喜欢到这里面来乱七八糟的乱翻,这就像女人爱逛地摊一样。不时地都能有些新发现。
好吧,我尽量按时间来添加,以免你看过了不用重复看。
不要指望我按类分门别类好,那是娘们做的事情。我的blog就是无序的,就像我的狗窝一样,脏乱差。


----------------------------废话分割线------------------------------------------------------

2009/11
1.可以用KDbgCtrl来配置以下Windbg的Kernel debugging行为。比如:
When User-Mode Error Handling is enabled, some user-mode events will cause the target computer to break into the kernel debugger

2."听出"你的bug来,让蜂鸣器发出beep声来判断程序执行的路径。适用于特殊情况下无法使用Kernel Debugger的时候。
 Debugging Without a Debugger(http://blogs.msdn.com/ntdebugging/archive/2009/05/21/debugging-without-a-debugger.aspx)

BTW,有些设备也可以写80端口用Led来显示。用int 10中断调用bios来写屏幕,64端口重启大法??(语焉不详,不清楚是什么)

3.使用Kernel mode调试器来调一些user mode的程序,主要用于需要同时调applicaion和driver.

可以用加个"int 3"在application里面,这样就能断倒kernel mode debugger了。

也许用KDbgCtrl改一些配置也能让kernel mode debugger调到user mode代码。

How to Access the User Mode Debugger from the Kernel Debugger(http://www.google.com/reader/view/#stream/feed%2Fhttp%3A%2F%2Fblogs.msdn.com%2Fntdebugging%2Frss.xml) 这篇文章提公的方法是,启动一个user mode调试器,然后在Kernel mode debugger中控制他。

当然了,也可以给user mode的address下一个断点,不过这个比较复杂,简单的说要给某一个process下断点,首先要切换到这个进程。考虑,断点都是下载虚拟地址上的,比如有page table才能找到下断点的地方。

这有一篇很不错的文章关于<<在内核调试会话中设置用户态断点>>(http://advdbg.com/blogs/advdbg_system/articles/1492.aspx)

 4.Register for Debug.

 postmorten debugger.程序崩溃以后自动起来的调试器

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug

Auto:1

Debuger:C:\Windbg.exe -xx -xx -xx -xx

Using "Windbg -I" to register Windbg as default  postmorten debugger for short.

5.双击调试的时候,如何响应用户态的一场

!gflags +soe

6. dd名字。

dds esp

原文地址:https://www.cnblogs.com/aoaoblogs/p/1602181.html