CDB를 사용한 원격 디버깅
원격 머신이나 컨테이너에서 Windows가 실행 중이고 애플리케이션이 MSVC를 사용하여 컴파일된 경우, CDB를 사용하여 원격 디버깅을 수행할 수 있습니다.
이미 애플리케이션의 원격 실행이 설정되어 있고 ‘ Run ’ 버튼(또는 Ctrl+R)을 선택했을 때 정상적으로 작동한다면, ‘ Debug ’ 버튼(또는 F5)을 선택하여 원격 디버깅을 시작할 수 있습니다.
원격 모드에서는 로컬 CDB 프로세스가 원격 컴퓨터에서 실행되는 CDB 프로세스와 통신합니다. 이 프로세스는 서버 모드로 전환하는 특수 명령줄 옵션을 사용하여 시작됩니다. 원격 CDB 프로세스는 Qt Creator 에 포함된 Qt Creator CDB 확장 라이브러리를 로드해야 합니다:
- 원격 컴퓨터에 Windows용 디버깅 도구(Debugging Tools for Windows )를 설치하십시오. 설치 폴더에는 CDB 명령줄 실행 파일(
cdb.exe)이 있습니다. - Qt 설치 디렉터리에서 Qt Creator CDB 확장 라이브러리와 종속성을 원격 컴퓨터의 새 폴더로 복사하십시오(사용 중인 Windows용 디버깅 도구의 버전에 따라 32비트 또는 64비트 버전 선택):
\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 프로세스 관리 설정을 지정하려면 ‘ Preferences ’ > ‘ 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.