如何从内核模式驱动程序中查看DbgPrint输出? [英] How do I get to see DbgPrint output from my kernel-mode driver?
问题描述
我发现很难看到正在处理的内核模式驱动程序的调试输出。
I'm finding it difficult to see the debug output from a kernel-mode driver I'm working on.
我是驱动开发的新手。我试图在Windows XP上调试USB驱动程序。我安装了DDK,并构建了我的驱动程序的检查模式。我已经安装了驱动程序,如果我使用十六进制编辑器查看我的驱动程序的.sys文件在Windows /驱动程序,我可以看到我的调试输出字符串的文本。
I'm new to driver development. I'm trying to debug a USB driver on Windows XP. I've installed the DDK, and built a "checked mode" build of my driver. I've installed the driver and if I use a hex editor to look at my driver's .sys file in windows/drivers, I can see the text of my debug output strings.
如果我运行的应用程序使用我的驱动程序在Visual Studio下,我的调试输出不会出现在输出窗口,因为应用程序自己的调试输出。搜索网络,我发现许多不同的声明,如何应该显示内核的调试输出。对于一般的内核调试,人们似乎可以通过空调制解调器电缆(Crikey,它是2012)进行远程调试,也可以使用虚拟机和虚拟通讯端口。这两种方法看起来像是大量的工作,只能看到调试输出。有没有其他选择?
If I run an app that uses my driver under Visual Studio, my debug output doesn't appear in the output window, as the application's own debug output does. Searching the web, I find many different claims about how one is supposed to display debug output from the kernel. For kernel debugging in general, people seem to either do remote debugging over a NULL modem cable (Crikey, it's 2012) or use a virtual machine and a virtual com port. Both these approaches seem like a massive amount of work just to be able to see debug output. Is there an alternative?
我在本地内核调试模式下尝试使用WinDbg,但没有显示任何内容。它警告,我应该重启Windows启用/ debug。我这样做,但没有帮助。
I've tried using WinDbg in "Local" kernel debugging mode but it doesn't show anything. It warned that I should reboot windows with "/debug" enabled. I did that, but it didn't help.
任何其他想法?或者我要求不可能?
Any other ideas? Or am I asking for the impossible?
推荐答案
DebugView将显示驱动程序的跟踪消息:
DebugView will show you the trace messages from your driver:
http://technet.microsoft.com/ en-us / sysinternals / bb896647.aspx
但是,您确实需要一台两台机器来进行任何真正的开发工作。
However, you really do need a two machine setup to do any real development work.
这篇关于如何从内核模式驱动程序中查看DbgPrint输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!