Skip to main content

IAR Embedded Workbench for RL78 5.20

Using C-SPY in batch mode

In this section:

You can execute C-SPY in batch mode if you use the command line utility cspybat, installed in the directory common\bin.

Starting cspybat

  1. To start cspybat you must first create a batch file. An easy way to do that is to use one of the batch files that C-SPY automatically generates when you start C-SPY in the IDE.

    C-SPY generates a batch file projectname.buildconfiguration.cspy.bat every time C-SPY is initialized. In addition, two more files are generated:

    • project.buildconfiguration.general.xcl, which contains options specific to cspybat

    • project.buildconfiguration.driver.xcl, which contains options specific to the C-SPY driver you are using

    You can find the files in the directory $PROJ_DIR$\settings. The files contain the same settings as the IDE, and provide hints about additional options that you can use.

  2. To start cspybat, you can use this command line:

    project.cspybat.bat [debugfile]

    Note that debugfile is optional. You can specify it if you want to use a different debug file than the one that is used in the project.buildconfiguration.general.xcl file.

Output

When you run cspybat, these types of output can be produced:

  • Terminal output from cspybat itself

    All such terminal output is directed to stderr. Note that if you run cspybat from the command line without any arguments, the cspybat version number and all available options including brief descriptions are directed to stdout and displayed on your screen.

  • Terminal output from the application you are debugging

    All such terminal output is directed to stdout, provided that you have used the ‑‑plugin option. See ‑‑plugin.

  • Error return codes

    cspybat returns status information to the host operating system that can be tested in a batch file. For successful, the value int 0 is returned, and for unsuccessful the value int 1 is returned.

Invocation syntax

The invocation syntax for cspybat is:

cspybat processor_DLL driver_DLL debug_file
        [cspybat_options] ‑‑backend driver_options

Note

In those cases where a filename is required you are recommended to give a full path to the filename. For the DLL files it is mandatory.

Parameters

The parameters are:

Parameter

Description

processor_DLL

The path to the processor-specific DLL file—available in rl78\bin.

driver_DLL

The path to the C-SPY driver DLL file—available in rl78\bin.

debug_file

The object file that you want to debug (filename extension out). See also ‑‑debug_file.

cspybat_options

The command line options that you want to pass to cspybat. Note that these options are optional. For information about each option, see Reference information on C-SPY command line options.

‑‑backend

Marks the beginning of the parameters to the C-SPY driver; all options that follow will be sent to the driver. Note that this option is mandatory.

driver_options

The command line options that you want to pass to the C-SPY driver. Note that some of these options are mandatory and some are optional. For information about each option, see Reference information on C-SPY command line options.

Table 49. cspybat parameters