Skip to main content

IAR Embedded Workbench for Arm 10.10.x

C-SPYをバッチモードで使用

このセクションの内容:

コマンドラインユーティリティの cspybat を使用すると、C-SPY をバッチモードで実行できます。このユーティリティは、common\bin ディレクトリにインストールされています。

cspybat の起動

Using a JSON launch file

The most convenient way to start cspybat is to generate and use a launch.json file. This file can also be used with Visual Studio Code.

  1. The command syntax is:

    iarbuild project.ewp -launch_json [buildconfig]

    For example, this command:

    iarbuild project.ewp -launch_json Debug

    adds the Debug configuration to the file launch.json.

    You can also create this file in the IDE by choosing Debug>Launch Configuration>Export as JSON.

  2. Use this file by specifying --launch_file launch.json as options to the cspybat command on the command line. If you have more than one build configuration, use --launch_config to specify which one, for example:

    cspybat --launch_file launch.json --launch_config Debug

    For more information, see Saving and loading debugger launch settings.

Using an auto-generated batch file

You can also start cspybat using a batch file.

EWICO.png
  1. cspybatを起動するには、まずバッチファイルを作成する必要があります。その簡単な方法は、IDEでC-SPYを起動する際にC-SPYが自動的に生成するバッチファイルのいずれかを使用することです。

    C-SPY が初期化されるたびに、projectname.buildconfiguration.cspy.bat というバッチファイルが生成されます。また、あと 2 つのファイルが生成されます。

    • project.buildconfiguration.general.xclには、cspybatに固有のオプションが含まれます。

    このファイルは、$PROJ_DIR$\settingsディレクトリに保存されています。これらのファイルには IDE と同じ設定が含まれており、使用可能なオプションについてのヒントになります。

  2. cspybatを起動するには、次のコマンドラインを使用できます。

CLICO.png
  1. On the command line, you can create a batch file using iarbuild:

    iarbuild project.ewp -cspybat_cmds [buildconfig] -output_type filetype

    For example, this command:

    iarbuild project.ewp -cspybat_cmds Debug -output_type bat

    will create the batch file project.Debug.cspy.bat.

  2. Invoke the project.Debug.cspy.bat file on the command line to start cspybat.

    The file type can be another shell or batch type, for example sh if you work in a Linux environment.

注記

It is also possible to start an interactive debug session in the Embedded Workbench GUI. For more information, see Starting a debug session from the command line.

出力

cspybatの実行時、以下のタイプの出力を生成できます。

  • cspybatからのターミナル出力

    このターミナル出力はすべてstderrに転送されます。コマンドラインから引数なしでcspybatを実行する場合、cspybatのバージョン番号と利用可能なすべてのオプション(簡単な説明を含む)がstdoutに転送され、画面に表示されます。

  • デバッグ対象アプリケーションからのターミナル出力

    こうしたすべてのターミナル出力先は、stdoutになります。ただし、‑‑pluginオプションを使用していることが条件です。‑‑pluginを参照してください。

  • エラーリターンコード

    cspybat は、バッチファイル内で評価可能なステータス情報をホストオペレーティングシステムに返します。成功の場合は値int 0が、失敗の場合は値int 1がそれぞれ返されます。

呼び出し構文

cspybat の呼び出し構文は以下のとおりです。

cspybat processor_DLL driver_DLL debug_file
        [cspybat_options] ‑‑backend driver_options

注記

ファイル名が要求される場合には、ファイル名のフルパスを指定することが推奨されます。DLL ファイルの場合、必須です。

パラメータ

パラメータを以下に示します。

パラメータ

説明

processor_DLL

プロセッサ固有DLLファイルへのパスは、arm\bin で利用できます。

driver_DLL

C-SPYドライバDLLファイルへのパスは、arm\binで利用できます。

debug_file

デバッグ対象のオブジェクトファイルです(ファイル名拡張子 out)。‑‑debug_fileを参照してください。

cspybat_options

cspybat に渡すコマンドラインオプションです。これらのオプションは省略可能です。それぞれのオプションについては、C-SPYコマンドラインオプションについてのリファレンス情報を参照してください。

‑‑backend

C-SPY ドライバに送信するパラメータの開始を示します。後に続くすべてのオプションがドライバに渡されます。このオプションは必須です。

driver_options

C-SPY ドライバに渡すコマンドラインオプションです。これらのオプションには、必須のものと省略可能なものがあります。それぞれのオプションについては、C-SPYコマンドラインオプションについてのリファレンス情報を参照してください。

表63 cspybat のパラメータ