CDB 命令行选项CDB Command-Line Options

CDB 或 NTSD 的首次用户应从使用 CDB 和 ntsd部分进行调试开始。First-time users of CDB or NTSD should begin with the Debugging Using CDB and NTSD section.

CDB 命令行使用以下语法:The CDB command line uses the following syntax:

cdb  [ -server ServerTransport | -remote ClientTransport ] 
[ -premote SmartClientTransport ] [-log{a|au|o|ou} LogFile]
[-2] [-d] [-ddefer] [-g] [-G] [-hd] [-lines] [-myob] [-bonc] 
[-n] [-o] [-s] [-v] [-w] [-cf "filename"] [-cfr "filename"] [-c "command"] 
[-robp] [-r BreakErrorLevel]  [-t PrintErrorLevel] 
[ -x{e|d|n|i} Exception ] [-x] [-clines lines] 
[-i ImagePath]  [-y SymbolPath] [-srcpath SourcePath] 
[-aExtension] [-failinc] [-noio] [-noinh] [-noshell] [-nosqm]
[-sdce] [-ses] [-sicv] [-sins] [-snc] [-snul] [-zp PageFile] 
[-sup] [-sflags 0xNumber] [-ee {masm|c++}]
[-e Event] [-pb] [-pd] [-pe] [-pr] [-pt Seconds] [-pv] 
[ -- | -p PID | -pn Name | -psn ServiceName | -z DumpFile | executable ] 
[-cimp] [-isd] [-kqm] [-pvr] [-version] [-vf] [-vf:<opts>] [-netsyms:{yes|no}]

cdb -iae 

cdb -iaec KeyString 

cdb -iu KeyString

cdb -QR Server 

cdb -wake pid 

cdb -?

NTSD 命令行语法与 CDB 的命令行语法相同:The NTSD command-line syntax is identical to that of CDB:

ntsd  [ -server ServerTransport | -remote ClientTransport ] 
[ -premote SmartClientTransport ] [-log{a|au|o|ou} LogFile]
[-2] [-d] [-ddefer] [-g] [-G] [-hd] [-lines] [-myob] [-bonc] 
[-n] [-o] [-s] [-v] [-w] [-cf "filename"] [-cfr "filename"] [-c "command"] 
[-robp] [-r BreakErrorLevel]  [-t PrintErrorLevel] 
[ -x{e|d|n|i} Exception ] [-x] [-clines lines] 
[-i ImagePath]  [-y SymbolPath] [-srcpath SourcePath] 
[-aExtension] [-failinc] [-noio] [-noinh] [-noshell] [-nosqm]
[-sdce] [-ses] [-sicv] [-sins] [-snc] [-snul] [-zp PageFile] 
[-sup] [-sflags 0xNumber] [-ee {masm|c++}] 
[-e Event] [-pb] [-pd] [-pe] [-pr] [-pt Seconds] [-pv] 
[ -- | -p PID | -pn Name | -psn ServiceName | -z DumpFile | executable ] 
[-cimp] [-isd] [-kqm] [-pvr] [-version] [-vf] [-vf:<opts>] [-netsyms:{yes|no}]

ntsd -iae 

ntsd -iaec KeyString 

ntsd -iu KeyString

ntsd -QR Server 

ntsd -wake PID 

ntsd -?

NTSD 和 CDB 之间唯一的区别是,NTSD 会生成新的控制台窗口,而 CDB 会继承从中调用它的窗口。The only difference between NTSD and CDB is that NTSD spawns a new console window while CDB inherits the window from which it was invoked. 由于 "启动" 命令还可用于生成新的控制台窗口,因此以下两个构造将产生相同的结果:Since the start command can also be used to spawn a new console window, the following two constructions will give the same results:

start cdb [parameters]
ntsd [parameters]

下面是 CDB 和 NTSD 命令行选项的说明。Descriptions of the CDB and NTSD command-line options follow. 只有 -remote-server-g-g选项区分大小写。Only the -remote, -server, -g and -G options are case-sensitive. 可以使用正斜杠(/)替换初始连字符。The initial hyphen can be replaced with a forward-slash (/). 可以连接不采用任何其他参数的选项,因此,可以将cdb-o-g -g winmine 编写为cdb-odGg winmineOptions that do not take any additional parameters can be concatenated -- so cdb -o -d -G -g winmine can be written as cdb -odGg winmine.

如果使用了 -remote-server选项,则它必须出现在命令行上的任何其他选项之前。If the -remote or -server option is used, it must appear before any other options on the command line. 如果指定了可执行文件,则它必须出现在命令行的最后;可执行文件名称后的任何文本都作为其自身的命令行参数传递给可执行程序。If an executable is specified, it must appear last on the command line; any text after the executable name is passed to the executable program as its own command-line parameters.

ParametersParameters

-server ServerTransport -server ServerTransport
创建可由其他调试器访问的调试服务器。Creates a debugging server that can be accessed by other debuggers. 有关可能的ServerTransport值的说明,请参阅激活调试服务器For an explanation of the possible ServerTransport values, see Activating a Debugging Server. 使用此参数时,该参数必须是命令行中的第一个参数。When this parameter is used, it must be the first parameters on the command line.

-remote ClientTransport -remote ClientTransport
创建调试客户端,并连接到已在运行的调试服务器。Creates a debugging client, and connects to a debugging server that is already running. 有关可能的ClientTransport值的说明,请参阅激活调试客户端For an explanation of the possible ClientTransport values, see Activating a Debugging Client. 使用此参数时,该参数必须是命令行中的第一个参数。When this parameter is used, it must be the first parameters on the command line.

-premote SmartClientTransport -premote SmartClientTransport
创建智能客户端,并连接到已在运行的进程服务器。Creates a smart client, and connects to a process server that is already running. 有关可能的SmartClientTransport值的说明,请参阅激活智能客户端For an explanation of the possible SmartClientTransport values, see Activating a Smart Client.

-2 -2
如果目标应用程序是一个控制台应用程序,则此选项会使其在新的控制台窗口中出现。If the target application is a console application, this option causes it to live in a new console window. (对于目标控制台应用程序,使用 CDB 或 NTSD 共享窗口的默认值为。)(The default is for a target console application to share the window with CDB or NTSD.)

-- --
调试客户端服务器运行时子系统(CSRSS)。Debugs the Client Server Run-Time Subsystem (CSRSS). 有关详细信息,请参阅调试 CSRSSFor details, see Debugging CSRSS.

- 扩展 -a Extension
设置默认扩展 DLL。Sets the default extension DLL. 默认值为userextsThe default is userexts. "A" 后面一定不能有空格,并且不得包含 .dll 扩展名。There must be no space after the "a", and the .dll extension must not be included. 有关详细信息和设置此默认设置的其他方法,请参阅加载调试器扩展 dllFor details, and other methods of setting this default, see Loading Debugger Extension DLLs.

-bonc -bonc
如果指定此选项,则调试器将在会话开始时立即进入目标。If this option is specified, the debugger will break into the target as soon as the session begins. 这在连接到可能当前未分解到目标的调试服务器时特别有用。This is especially useful when connecting to a debugging server that might not be currently broken into the target.

-c " command " -c " command "
指定要在启动时运行的初始调试器命令。Specifies the initial debugger command to run at start-up. 此命令必须用引号引起来。This command must be surrounded with quotation marks. 可以用分号分隔多个命令。Multiple commands can be separated with semicolons. (如果您有一个长命令列表,则可以更容易地将其放入脚本,然后将 -c选项与$<,$><,$><,$ $>< (运行脚本文件)命令一起使用。)(If you have a long command list, it may be easier to put them in a script and then use the -c option with the $<, $><, $><, $$>< (Run Script File) command.)

如果要启动调试客户端,则必须将此命令用于调试服务器。If you are starting a debugging client, this command must be intended for the debugging server. 不允许使用客户端特定的命令(如lsrcpath )。Client-specific commands such as .lsrcpath are not allowed.

-cf " filename " -cf " filename "
指定脚本文件的路径和名称。Specifies the path and name of a script file. 启动调试器后,将立即执行该脚本文件。This script file is executed as soon as the debugger is started. 如果filename包含空格,则必须用引号将其引起来。If filename contains spaces it must be enclosed in quotation marks. 如果省略该路径,则假定为当前目录。If the path is omitted, the current directory is assumed. 如果未使用 -cf选项,则使用当前目录中的文件 ntsd 作为脚本文件。If the -cf option is not used, the file ntsd.ini in the current directory is used as the script file. 如果文件不存在,则不会发生错误。If the file does not exist, no error occurs. 有关详细信息,请参阅使用脚本文件For details, see Using Script Files.

-cfr " filename " -cfr " filename "
指定脚本文件的路径和名称。Specifies the path and name of a script file. 一旦启动调试器,就会执行该脚本文件,并在每次重新启动目标时执行。This script file is executed as soon as the debugger is started, and any time the target is restarted. 如果filename包含空格,则必须用引号将其引起来。If filename contains spaces it must be enclosed in quotation marks. 如果省略该路径,则假定为当前目录。If the path is omitted, the current directory is assumed. 如果文件不存在,则不会发生错误。If the file does not exist, no error occurs. 有关详细信息,请参阅使用脚本文件For details, see Using Script Files.

-cimp -cimp
指示 CDB/NTSD 以 DbgSrv 的隐式命令行(而不是要运行的显式进程)开头。Directs CDB/NTSD to start with a DbgSrv implicit command line instead of an explicit process to run. 此选项是 dbgsrv 的客户端。This option is the client side of dbgsrv -pc.

-clines -clines lines
设置在远程调试过程中可以访问的命令历史记录中的大概命令数。Sets the approximate number of commands in the command history which can be accessed during remote debugging. 有关详细信息以及其他更改此数字的方法,请参阅使用调试器命令For details, and for other ways to change this number, see Using Debugger Commands.

-d -d
将此调试器的控制权传递给内核调试器。Passes control of this debugger to the kernel debugger. 如果正在调试 CSRSS,此控件重定向始终处于活动状态,即使未指定 -d也是如此。If you are debugging CSRSS, this control redirection always is active, even if -d is not specified. (在远程调试过程中不能使用此选项--请改用ddefer 。)有关详细信息,请参阅从内核调试器控制用户模式调试器(This option cannot be used during remote debugging -- use -ddefer instead.) See Controlling the User-Mode Debugger from the Kernel Debugger for details. 此选项不能与 -ddefer选项或 -noio选项一起使用。This option cannot be used in conjunction with either the -ddefer option or the -noio option.

请注意  如果使用 windbg 作为内核调试器,则在此方案中,很多熟悉的 windbg 功能不可用。Note  If you use WinDbg as the kernel debugger, many of the familiar features of WinDbg are not available in this scenario. 例如,不能使用 "局部变量" 窗口、"反汇编" 窗口或 "调用堆栈" 窗口,也不能单步执行源代码。For example, you cannot use the Locals window, the Disassembly window, or the Call Stack window, and you cannot step through source code. 这是因为 WinDbg 只充当在目标计算机上运行的调试器(NTSD 或 CDB)的查看器。This is because WinDbg is only acting as a viewer for the debugger (NTSD or CDB) running on the target computer.

-ddefer -ddefer
将此调试器的控制权传递给内核调试器,除非连接了调试客户端。Passes control of this debugger to the kernel debugger, unless a debugging client is connected. (这是一个 -d变体,可以从调试服务器使用。)有关详细信息,请参阅从内核调试器控制用户模式调试器(This is a variation of -d that can be used from a debugging server.) See Controlling the User-Mode Debugger from the Kernel Debugger for details. 此选项不能与 -d选项或 -noio选项一起使用。This option cannot be used in conjunction with either the -d option or the -noio option.

-e 事件 -e Event
向调试器发出指定事件的信号。Signals the debugger that the specified event has occurred. 仅当以编程方式启动调试器时才使用此选项。This option is only used when starting the debugger programmatically.

-ee {masm|c + +} -ee {masm|c++}
设置默认表达式计算器。Sets the default expression evaluator. 如果指定了masm ,将使用 masm 表达式语法。If masm is specified, MASM expression syntax will be used. 如果指定c + + , C++则使用 expression 语法。If c++ is specified, C++ expression syntax will be used. 如果省略 -ee选项,则将使用 MASM 表达式语法作为默认值。If the -ee option is omitted, MASM expression syntax is used as the default. 有关详细信息,请参阅计算表达式See Evaluating Expressions for details.

-failinc -failinc
导致调试器忽略任何有问题的符号。Causes the debugger to ignore any questionable symbols. 调试用户模式或内核模式小型转储文件时,此选项还会阻止调试器加载其图像无法映射的任何模块。When debugging a user-mode or kernel-mode minidump file, this option will also prevent the debugger from loading any modules whose images can't be mapped. 有关详细信息和控制此方法的其他方法,请参阅SYMOPT_精确_符号For details and for other methods of controlling this, see SYMOPT_EXACT_SYMBOLS.

-g -g
忽略目标应用程序中的初始断点。Ignores the initial breakpoint in target application. 此选项将导致目标应用程序在启动后继续运行,或将 CDB 附加到该应用程序,除非已设置了另一个断点。This option will cause the target application to continue running after it is started or CDB attaches to it, unless another breakpoint has been set. 有关详细信息,请参阅初始断点See Initial Breakpoint for details.

-G -G
在进程终止时忽略最终断点。Ignores the final breakpoint at process termination. 默认情况下,在映像运行进程中,CDB 停止。By default, CDB stops during the image run-down process. 当子级终止时,此选项将导致 CDB 立即退出。This option will cause CDB to exit immediately when the child terminates. 这与输入命令sxd epr相同。This has the same effect as entering the command sxd epr. 有关详细信息,请参阅控制异常和事件For more information, see Controlling Exceptions and Events.

-hd -hd
指定不应使用调试堆。Specifies that the debug heap should not be used. 有关详细信息,请参阅使用 CDB 调试用户模式进程See Debugging a User-Mode Process Using CDB for details.

-i ImagePath -i ImagePath
指定生成错误的可执行文件的位置。Specifies the location of the executables that generated the fault. 如果路径包含空格,则应该用引号将其引起来。If the path contains spaces, it should be enclosed in quotation marks.

-iae -iae
将 CDB 安装为事后调试器。Installs CDB as the postmortem debugger. 有关详细信息,请参阅启用事后调试For details, see Enabling Postmortem Debugging.

如果此操作成功,则不会显示任何消息;如果失败,将显示一条错误消息。If this action succeeds, no message is displayed; if it fails, an error message is displayed.

-Iae参数不得与任何其他参数一起使用。The -iae parameter must not be used with any other parameters. 此命令实际上不会启动 CDB。This command will not actually start CDB.

-iaec KeyString -iaec KeyString
将 CDB 安装为事后调试器。Installs CDB as the postmortem debugger. KeyString的内容将追加到AeDebug注册表项的结尾。The contents of KeyString will be appended to the end of the AeDebug registry key. 如果KeyString包含空格,则必须用引号将其引起来。If KeyString contains spaces, it must be enclosed in quotation marks. 有关详细信息,请参阅启用事后调试For details, see Enabling Postmortem Debugging.

如果此操作成功,则不会显示任何消息;如果失败,将显示一条错误消息。If this action succeeds, no message is displayed; if it fails, an error message is displayed.

-Iaec参数不得与任何其他参数一起使用。The -iaec parameter must not be used with any other parameters. 此命令实际上不会启动 CDB。This command will not actually start CDB.

-isd -isd
为任何进程创建启用 "创建_忽略_系统_默认标志。Turns on the CREATE_IGNORE_SYSTEM_DEFAULT flag for any process creations.

-iu KeyString -iu KeyString
将调试器远程处理注册为 URL 类型,以便用户可以使用 URL 自动启动调试器远程客户端。Registers debugger remoting as an URL type so that users can auto-launch a debugger remote client with an URL. KeyString的格式 remdbgeng://RemotingOptionKeyString has the format remdbgeng://RemotingOption. RemotingOption是一个字符串,它定义在激活调试客户端主题中定义的传输协议。RemotingOption is a string that defines the transport protocol as defined in the topic Activating a Debugging Client. 如果此操作成功,则不会显示任何消息;如果失败,将显示一条错误消息。If this action succeeds, no message is displayed; if it fails, an error message is displayed.

-Iu参数不得与任何其他参数一起使用。The -iu parameter must not be used with any other parameters. 此命令实际上不会启动 CDB。This command will not actually start CDB.

-kqm -kqm
在安静模式下启动 CDB/NTSD。Starts CDB/NTSD in quiet mode.

-行 -lines
启用源代码行调试。Enables source line debugging. 如果省略此选项,则在允许进行源调试之前,必须使用 "行(切换源代码行支持) " 命令。If this option is omitted, the .lines (Toggle Source Line Support) command will have to be used before source debugging will be allowed. 有关控制此情况的其他方法,请参阅SYMOPT_LOAD_行For other methods of controlling this, see SYMOPT_LOAD_LINES.

-log{a | au | o | ou}日志文件 -log{a|au|o|ou} LogFile
开始将信息记录到日志文件。Begins logging information to a log file. 如果指定的文件已存在,则会在使用 -徽标时覆盖该文件,如果使用-loga,则输出将追加到该文件。If the specified file already exists, it will be overwritten if -logo is used, or output will be appended to the file if -loga is used. -Logau-logou选项分别与 -loga-徽标分别操作,只不过日志文件是 Unicode 文件。The -logau and -logou options operate similar to -loga and -logo respectively, except that the log file is a Unicode file. 有关更多详细信息,请参阅在 CDB 中保留日志文件For more details, see Keeping a Log File in CDB.

-myob -myob
如果版本与 dbghelp.dll 不匹配,则调试器将继续运行。If there is a version mismatch with dbghelp.dll, the debugger will continue to run. (如果没有 -myob开关,此错误将被视为错误。)(Without the -myob switch, this is considered a fatal error.)

-n -n
干扰符号加载:从符号处理程序启用详细输出。Noisy symbol load: Enables verbose output from the symbol handler. 有关详细信息和控制此方法的其他方法,请参阅SYMOPT_调试For details and for other methods of controlling this, see SYMOPT_DEBUG.

-netsyms {yes | no} -netsyms {yes|no}
允许或禁止从网络路径加载符号。Allow or disallow loading symbols from a network path.

-noinh -noinh
阻止调试器创建的进程从调试器继承句柄。Prevents processes created by the debugger from inheriting handles from the debugger. 有关控制此操作的其他方法,请参阅使用 CDB 调试用户模式进程For other methods of controlling this, see Debugging a User-Mode Process Using CDB.

-noio -noio
阻止调试服务器用于输入或输出。Prevents the debugging server from being used for input or output. 仅从调试客户端(以及由 -c命令行选项指定的任何初始命令或命令脚本)接受输入。Input will only be accepted from the debugging client (plus any initial command or command script specified by the -c command-line option).

所有输出都将定向到调试客户端。All output will be directed to the debugging client. 如果服务器使用了 NTSD,则根本不会创建控制台窗口。If NTSD is used for the server, no console window will be created at all. 有关更多详细信息,请参阅激活调试服务器For more details, see Activating a Debugging Server. 此选项不能与 -d选项或 -ddefer选项一起使用。This option cannot be used in conjunction with either the -d option or the -ddefer option.

-noshell -noshell
禁止全部shell命令。Prohibits all .shell commands. 即使启动了新的调试会话,此禁止仍将在调试器运行的时间结束。This prohibition will last as long as the debugger is running, even if a new debugging session is begun. 有关详细信息,以及其他禁用shell命令的方法,请参阅使用 shell 命令For details, and for other ways to disable .shell commands, see Using Shell Commands.

-nosqm -nosqm
禁用遥测数据收集和上载。Disables telemetry data collection and upload.

-o -o
调试由目标应用程序启动的所有进程(子进程)。Debugs all processes launched by the target application (child processes). 默认情况下,由正在调试的进程创建的进程将按正常运行的方式运行。By default, processes created by the one you are debugging will run as they normally do. 有关控制此操作的其他方法,请参阅使用 CDB 调试用户模式进程For other methods of controlling this, see Debugging a User-Mode Process Using CDB.

-p PID -p PID
指定要调试的十进制进程 ID。Specifies the decimal process ID to be debugged. 这用于调试已经在运行的进程。This is used to debug a process that is already running. 有关详细信息,请参阅使用 CDB 调试用户模式进程For details, see Debugging a User-Mode Process Using CDB.

-pb -pb
阻止调试器在附加到目标进程时请求初始中断。Prevents the debugger from requesting an initial break-in when attaching to a target process. 如果应用程序已挂起,或者您想要避免在目标中创建一个中断线程,这会很有用。This can be useful if the application is already suspended, or if you wish to avoid creating a break-in thread in the target.

-pd -pd
使目标应用程序不会在调试会话结束时终止。Causes the target application not to be terminated at the end of the debugging session. 有关详细信息,请参阅在 CDB 中结束调试会话See Ending a Debugging Session in CDB for details.

-pe -pe
指示目标应用程序已在进行调试。Indicates that the target application is already being debugged. 有关详细信息,请参阅重新附加到目标应用程序See Re-attaching to the Target Application for details.

-pn Name -pn Name
指定要调试的进程的名称。Specifies the name of the process to be debugged. (此名称必须是唯一的。)这用于调试已经在运行的进程。(This name must be unique.) This is used to debug a process that is already running.

-pr -pr
导致调试器在附加到目标进程时启动该进程。Causes the debugger to start the target process running when it attaches to it. 这在应用程序已挂起且你希望它恢复执行时非常有用。This can be useful if the application is already suspended and you wish it to resume execution.

-psn ServiceName -psn ServiceName
指定要调试的进程中包含的服务的名称。Specifies the name of a service contained in the process to be debugged. 这用于调试已经在运行的进程。This is used to debug a process that is already running.

-pt -pt Seconds
指定中断超时(以秒为单位)。Specifies the break time-out, in seconds. 默认值为30。The default is 30. 有关详细信息,请参阅控制目标See Controlling the Target for details.

-pv -pv
指定调试器应附加到目标进程 noninvasively。Specifies that the debugger should attach to the target process noninvasively. 有关详细信息,请参阅Noninvasive 调试(用户模式)For details, see Noninvasive Debugging (User Mode).

-pvr -pvr
类似于 -pv ,但目标进程不会挂起。Works like -pv except that the target process is not suspended.

-QR 服务器 -QR Server
列出在指定的网络服务器上运行的所有调试服务器。Lists all debugging servers running on the specified network server. 双反斜杠(\) 上一服务器是可选的。The double backslash (\) preceding Server is optional. 有关详细信息,请参阅搜索调试服务器See Searching for Debugging Servers for details.

-QR参数不能与任何其他参数一起使用。The -QR parameter cannot be used with any other parameters. 此命令实际上不会启动 CDB。This command will not actually start CDB.

-r BreakErrorLevel -r BreakErrorLevel
指定将导致目标中断到调试器中的错误级别。Specifies the error level that will cause the target to break into the debugger. 这是一个十进制数,等于0、1、2或3。This is a decimal number equal to 0, 1, 2, or 3. 可能的值如下:Possible values are as follows:

ValueValue ConstantConstant 含义Meaning

00

NONENONE

不要在出现任何错误时中断。Do not break on any errors.

11

错误ERROR

错误级别调试事件时中断。Break on ERROR level debugging events.

22

MINORERRORMINORERROR

在 MINORERROR 和错误级别调试事件时中断。Break on MINORERROR and ERROR level debugging events.

33

警告WARNING

在警告、MINORERROR 和错误级别调试事件时中断。Break on WARNING, MINORERROR, and ERROR level debugging events.

此错误级别仅在已检查的 Microsoft Windows 版本中具有意义。This error level only has meaning in checked builds of Microsoft Windows. 默认值为 1。The default value is 1. 在 Windows 10 版本1803之前,已检查的生成在较早版本的 Windows 上可用。Checked builds were available on older versions of Windows, before Windows 10 version 1803.

-robp -robp
这允许 CDB 在只读内存页面上设置断点。This allows CDB to set a breakpoint on a read-only memory page. (此类操作的默认值为失败。)(The default is for such an operation to fail.)

-s -s
禁用延迟符号加载。Disables lazy symbol loading. 这会降低进程启动的速度。This will slow down process startup. 有关详细信息和控制此方法的其他方法,请参阅SYMOPT_延迟_负载For details and for other methods of controlling this, see SYMOPT_DEFERRED_LOADS.

-sdce -sdce
使调试器在符号加载过程中显示文件访问错误对话框。Causes the debugger to display File access error dialog boxes during symbol load. 有关详细信息,请参阅SYMOPT_失败_严重_错误For details and for other methods of controlling this, see SYMOPT_FAIL_CRITICAL_ERRORS.

-ses -ses
使调试器对所有符号文件执行严格的评估,并忽略任何有问题的符号。Causes the debugger to perform a strict evaluation of all symbol files and ignore any questionable symbols. 有关详细信息和控制此方法的其他方法,请参阅SYMOPT_精确_符号For details and for other methods of controlling this, see SYMOPT_EXACT_SYMBOLS.

-sflags 0x Number -sflags 0x Number
同时设置所有符号处理程序选项。Sets all the symbol handler options at once. Number应为以0x开头的十六进制数字,不允许使用0x ,但符号选项是二进制标志,因此建议使用十六进制。Number should be a hexadecimal number prefixed with 0x -- a decimal without the 0x is permitted, but the symbol options are binary flags and therefore hexadecimal is recommended. 应谨慎使用此选项,因为它将覆盖所有符号处理程序默认值。This option should be used with care, since it will override all the symbol handler defaults. 有关详细信息,请参阅设置符号选项For details, see Setting Symbol Options.

-sicv -sicv
导致符号处理程序忽略 CV 记录。Causes the symbol handler to ignore the CV record. 有关详细信息和控制此方法的其他方法,请参阅SYMOPT_IGNORE_CVRECFor details and for other methods of controlling this, see SYMOPT_IGNORE_CVREC.

-问题 -sins
导致调试器忽略符号路径和可执行图像路径环境变量。Causes the debugger to ignore the symbol path and executable image path environment variables. 有关详细信息,请参阅SYMOPT_IGNORE_NT_SYMPATHFor details, see SYMOPT_IGNORE_NT_SYMPATH.

-snc -snc
使调试器关闭C++转换。Causes the debugger to turn off C++ translation. 有关详细信息和控制此方法的其他方法,请参阅SYMOPT_no_CPPFor details and for other methods of controlling this, see SYMOPT_NO_CPP.

-snul -snul
为非限定名称禁用自动符号加载。Disables automatic symbol loading for unqualified names. 有关详细信息和控制此方法的其他方法,请参阅SYMOPT_未_未限定的_负载For details and for other methods of controlling this, see SYMOPT_NO_UNQUALIFIED_LOADS.

-srcpath SourcePath -srcpath SourcePath
指定源文件搜索路径。Specifies the source file search path. 使用分号(;) 分隔多个路径。Separate multiple paths with a semicolon (;). 如果路径包含空格,则应该用引号将其引起来。If the path contains spaces, it should be enclosed in quotation marks. 有关详细信息,请参阅源路径For details, and for other ways to change this path, see Source Path.

-sup -sup
使符号处理程序在每个符号搜索过程中搜索公共符号表。Causes the symbol handler to search the public symbol table during every symbol search. 有关详细信息和控制此方法的其他方法,请参阅SYMOPT_AUTO_PUBLICSFor details and for other methods of controlling this, see SYMOPT_AUTO_PUBLICS.

-t PrintErrorLevel -t PrintErrorLevel
指定将导致调试器显示错误消息的错误级别。Specifies the error level that will cause the debugger to display an error message. 这是一个十进制数,等于0、1、2或3。This is a decimal number equal to 0, 1, 2, or 3. 可能的值如下:Possible values are as follows:

ValueValue ConstantConstant 含义Meaning

00

NONENONE

不显示任何错误。Do not display any errors.

11

错误ERROR

显示错误级别调试事件。Display ERROR level debugging events.

22

MINORERRORMINORERROR

显示 MINORERROR 和错误级别调试事件。Display MINORERROR and ERROR level debugging events.

33

警告WARNING

显示警告、MINORERROR 和错误级别调试事件。Display WARNING, MINORERROR, and ERROR level debugging events.

此错误级别仅在已检查的 Microsoft Windows 版本中具有意义。This error level only has meaning in checked builds of Microsoft Windows. 在 Windows 10 版本1803之前,已检查的生成在 windows 的早期版本上可用。Checked builds were available on older versions of Windows before Windows 10, version 1803. 默认值为 1。The default value is 1.

-v -v
从调试器启用详细输出。Enables verbose output from the debugger.

-版本 -version
打印调试器版本字符串。Prints the debugger version string.

-vf -vf
启用默认 ApplicationVerifier 设置。Enables default ApplicationVerifier settings.

-vf: <的> -vf: <opts>
启用给定的 ApplicationVerifier 设置。Enables given ApplicationVerifier settings.

-w -w
指定在单独的 VDM 中调试16位应用程序。Specifies to debug 16-bit applications in a separate VDM.

-唤醒 PID -wake PID
使睡眠模式对于其进程 ID 由PID指定的用户模式调试器结束。Causes sleep mode to end for the user-mode debugger whose process ID is specified by PID. 在睡眠模式下,必须在目标计算机上发出此命令。This command must be issued on the target machine during sleep mode. 有关详细信息,请参阅从内核调试器控制用户模式调试器See Controlling the User-Mode Debugger from the Kernel Debugger for details.

-唤醒参数不应与任何其他参数一起使用。The -wake parameter should not be used with any other parameters. 此命令实际上不会启动 CDB。This command will not actually start CDB.

-x{e|d|n|i}异常 -x{e|d|n|i} Exception
控制调试器在发生指定事件时的行为。Controls the debugger's behavior when the specified event occurs. 异常可以是异常号或事件代码。The Exception can be either an exception number or an event code. 可以多次指定此选项以控制不同的事件。You can specify this option multiple times to control different events. 有关详细信息和其他控制这些设置的方法,请参阅控制异常和事件See Controlling Exceptions and Events for details and for other methods of controlling these settings.

-x -x
禁用对访问冲突异常的第一次中断。Disables first-chance break on access violation exceptions. 第二次出现访问冲突时将中断调试器。The second occurrence of an access violation will break into the debugger. 这与 -xd av相同。This is the same as -xd av.

-y SymbolPath -y SymbolPath
指定符号搜索路径。Specifies the symbol search path. 使用分号(;) 分隔多个路径。Separate multiple paths with a semicolon (;). 如果路径包含空格,则应该用引号将其引起来。If the path contains spaces, it should be enclosed in quotation marks. 有关详细信息和更改此路径的其他方式,请参阅符号路径For details, and for other ways to change this path, see Symbol Path.

-z DumpFile -z DumpFile
指定要调试的故障转储文件的名称。Specifies the name of a crash dump file to debug. 如果路径和文件名包含空格,则必须用引号将其引起来。If the path and file name contain spaces, this must be surrounded by quotation marks. 可以通过包含多个z选项来一次打开多个转储文件,每个转储文件后跟不同的DumpFile值。It is possible to open several dump files at once by including multiple -z options, each followed by a different DumpFile value. 有关详细信息,请参阅分析用户模式转储文件For details, see Analyzing a User-Mode Dump File.

-zp 页面文件 -zp PageFile
指定已修改的页面文件的名称。Specifies the name of a modified page file. 如果正在调试转储文件,并且想要使用pagein (内存中的页)命令,此方法非常有用。This is useful if you are debugging a dump file and want to use the .pagein (Page In Memory) command. 不能将 -zp与标准 Windows 页面文件一起使用,只能使用经过特别修改的页面文件。You cannot use -zp with a standard Windows page file -- only specially-modified page files can be used.

可执行 executable
指定可执行进程的命令行。Specifies the command line of an executable process. 此操作用于启动新进程并对其进行调试。This is used to launch a new process and debug it. 这必须是命令行上的最后一项。This has to be the final item on the command line. 可执行文件名称后的所有文本都作为其参数字符串传递到可执行文件。All text after the executable name is passed to the executable as its argument string.

-? -?
显示命令行帮助文本。Displays command-line help text.

从 "开始" 启动调试器 |运行或在命令提示符窗口中,在应用程序的文件名后指定目标应用程序的参数。When you are starting the debugger from Start | Run or from a Command Prompt window, specify arguments for the target application after the application's file name. 例如:For instance:

cdb myexe arg1arg2