使用 CDB 进行远程调试
在远程模式下,本地 CDB 进程与远程机器上运行的 CDB 进程对话。该进程使用特殊的命令行选项启动,从而切换到服务器模式。远程 CDB 进程必须加载Qt Creator 附带的Qt Creator CDB 扩展库:
- 在远程计算机上安装Windows 调试工具。安装文件夹中有 CDB 命令行可执行文件 (
cdb.exe
)。 - 将Qt Creator CDB 扩展库和 Qt 安装目录中的依赖项复制到远程机器上的新文件夹(32 或 64 位版本,取决于所使用的 Windows 调试工具版本):
\lib\qtcreatorcdbext32
(32 位)\lib\qtcreatorcdbext64
(64 位)
- 设置 _NT_DEBUGGER_EXTENSION_PATH 环境变量,使其指向该文件夹。
- 要使用 TCP/IP 作为通信协议,请按以下步骤启动远程 CDB:
cdb.exe -server tcp:port=1234 <executable>
- 在运行Qt Creator 的本地计算机上,选择Debug >Start Debugging >Attach to Remote CDB Session 。
- 在Connection 字段中输入连接参数。例如,对于 TCP/IP:
Server:Port
如果选择其他协议,请指定其中一种替代格式:
tcp:server=Server,port=Port[,password=Password][,ipversion=6] tcp:clicon=Server,port=Port[,password=Password][,ipversion=6] npipe:server=Server,pipe=PipeName[,password=Password] com:port=COMPort,baud=BaudRate,channel=COMChannel[,password=Password] spipe:proto=Protocol,{certuser=Cert|machuser=Cert},server=Server,pipe=PipeName[,password=Password] ssl:proto=Protocol,{certuser=Cert|machuser=Cert},server=Server,port=Socket[,password=Password] ssl:proto=Protocol,{certuser=Cert|machuser=Cert},clicon=Server,port=Socket[,password=Password]
- 选择OK 开始调试。
要指定管理 CDB 进程的设置,请转至首选项>Debugger >CDB 。
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.