如何在启动时关闭 Windows 内核调试?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5182380/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 16:19:35  来源:igfitidea点击:

How to turn off Windows kernel debugging at boot time?

windowsdebuggingkernelwindbgboot

提问by Mark D Hymanson

I have a Vista 32 bit machine which I wanted to enable local kernel debugging on. In WinDbg I selected File/Kernel Debug and selected the Local tab and clicked ok. I got the following message.

我有一台 Vista 32 位机器,我想在它上面启用本地内核调试。在 WinDbg 中,我选择了文件/内核调试并选择了本地选项卡并单击了确定。我收到以下消息。

The system does not support local kernel debugging. ... Local kernel debugging is disabled by default in Windows Vista, you must run 'bcdedit -debug on' and reboot to enable it.

系统不支持本地内核调试。... Windows Vista 中默认禁用本地内核调试,您必须运行“bcdedit -debug on”并重新启动以启用它。

I naively followed the instructions and opened an elevated command prompt and typed 'bcdedit -debug on' and the rebooted.

我天真地按照说明打开了一个提升的命令提示符并输入了“bcdedit -debug on”并重新启动。

However, on reboot the system hangs when it gets to the logon screen - or just after I type in my username and password.

但是,在重新启动时,系统会在进入登录屏幕时挂起 - 或者在我输入用户名和密码之后。

I suspect what is happening is that because a debugger is enabled, user mode exceptions are being triggered in the kernel debugger process and it is waiting for me to enter some input from an attached debugger??

我怀疑发生的事情是因为启用了调试器,内核调试器进程中触发了用户模式异常,它正在等待我从附加的调试器输入一些输入?

I was hoping to debug on the actual target machine.

我希望在实际的目标机器上进行调试。

My problem is that every time I boot - whatever F8 boot option I choose - it always either hangs or gets so far and then reboots - and then hangs.

我的问题是,每次我启动时——无论我选择什么 F8 启动选项——它总是挂起或走得太远,然后重新启动——然后挂起。

Booting in Safe Mode - gets close to the logon screen and then reboots. Same applies for the command line and network boot options. Last known good config - hangs too.

以安全模式启动 - 接近登录屏幕,然后重新启动。这同样适用于命令行和网络引导选项。最后一个已知的良好配置 - 也挂起。

Is there any way to change the boot option before Windows loads so that I can turn off kernel debugging. I have only the one boot config which was, in hindsight, my problem - I should have created a copy of the first boot config for my debug boot option.

有什么方法可以在 Windows 加载之前更改引导选项,以便我可以关闭内核调试。我只有一个引导配置,事后看来,这是我的问题 - 我应该为我的调试引导选项创建第一个引导配置的副本。

Unfortunately the system doesn't have a serial port so I can't attempt to debug through that.

不幸的是,系统没有串行端口,所以我无法尝试通过它进行调试。

The only option I can think of now is to attempt to connect a debugger from a different machine through a USB port. However, don't I need to configure the target PC to accept a debugger on a USB port or will this just work if I get a proper debug USB cable?

我现在能想到的唯一选择是尝试通过 USB 端口连接来自不同机器的调试器。但是,我是否不需要将目标 PC 配置为在 USB 端口上接受调试器,或者如果我获得合适的调试 USB 电缆,这将起作用吗?

采纳答案by Mark D Hymanson

Worked out how to get the machine running again.

想出如何让机器再次运行。

Pressing F8 during reboot gives the Repair option. Selecting Repair and gives a number of other options including Restoring to a previous restore point and also opening a command prompt.

在重新启动期间按 F8 会提供修复选项。选择修复并提供许多其他选项,包括还原到以前的还原点以及打开命令提示符。

I had tried the following...

我曾尝试以下...

Opening a command prompt and typing "bcdedit -debug off" which was accepted but didn't seem to help. I then tried restoring to a restore point of a couple of days previous. Again I got a hang on reload.

打开命令提示符并键入“bcdedit -debug off”,这被接受但似乎没有帮助。然后我尝试恢复到几天前的还原点。我再次在重新加载时遇到了问题。

The reason,.... neither of these actually turned off the debug option for the boot config.

原因,.... 这些实际上都没有关闭启动配置的调试选项。

What I needed to do was: in the Repair menu - open a command prompt. Then type bcdedit /enum to list the boot configs. Then call

我需要做的是:在修复菜单中 - 打开命令提示符。然后键入 bcdedit /enum 以列出引导配置。然后打电话

bcdedit /set {default} debug off

I guess my initial attempts to call bcdedit -debug off were turning it off on the (which it already was) on the boot manager config because I didn't specify a particular config name.

我想我最初尝试调用 bcdedit -debug off 是在启动管理器配置上(它已经是)关闭它,因为我没有指定特定的配置名称。

回答by Oliver

There is no need for to use the repair option! Just press F10instead of F8, now you will be able to edit the bootparameter! Just delete /DEBUGand press enter to continue the boot process. After set use bcdedit -debug offto permanently change the debug option.

无需使用修复选项!只需按F10而不是F8,现在您就可以编辑引导参数了!只需删除/DEBUG并按回车键即可继续启动过程。设置后使用bcdedit -debug off永久更改调试选项。