CDBを使ったリモート・デバッグ

リモートマシンまたはコンテナが Windows を実行し、アプリケーションが MSVC を使用してコンパイルされている場合、リモートデバッグに CDB を使用できます。

アプリケーションのリモート実行がすでに設定されており、Run ボタン(またはCtrl+R)を選択することで動作する場合、Debug ボタン(またはF5)を選択することでリモートデバッグを開始できます。

リモートモードでは、ローカルのCDBプロセスはリモートマシン上で動作するCDBプロセスと対話します。このプロセスは、サーバーモードに切り替える特別なコマンドラインオプションで開始されます。リモート CDB プロセスは、Qt Creator に同梱されているQt Creator CDB 拡張ライブラリをロードする必要があります:

  1. リモート・マシンにWindows用デバッグ・ツールをインストールする。インストールフォルダにはCDBコマンドライン実行ファイル(cdb.exe)があります。
  2. Qt インストールディレクトリからQt Creator CDB 拡張ライブラリと依存関係をリモートマシンの新しいフォルダにコピーします(使用する Windows 用 Debugging Tools のバージョンに応じて 32 ビット版または 64 ビット版):
    • \lib\qtcreatorcdbext32 (32 ビット)
    • \lib\qtcreatorcdbext64 (64 ビット)
  3. NT_DEBUGGER_EXTENSION_PATH環境変数を設定して、そのフォルダを指すようにします。
  4. 通信プロトコルとしてTCP/IPを使用する場合は、以下のようにリモートCDBを起動します:
    cdb.exe -server tcp:port=1234 <executable>
  5. Qt Creator を実行しているローカルマシンで、Debug >Start Debugging >Attach to Remote CDB Session を選択します。
  6. 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]
  7. デバッグを開始するには、OK を選択する。

CDBプロセスを管理するための設定を指定するには、Preferences>Debugger >CDB に進みます。

方法: デバッグ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.