In this section:

Prerequisites

  • Renesas RX 2.05
  • The Parasoft C++test plugin for Eclipse

Integration Overview

The C++test plugin is integrated with e2 studio Eclipse IDE by means of the Eclipse plugin mechanism. When prompted to select the target platform, select the Other radio button and provide the path to the Eclipse folder within the e2 studio installation directory. Then continue the installation as normal.

Performing Unit Testing and Application Monitoring

Ensure that your project supports "Debug using Simulator". This can be verified by locating the "{project_name} Debug.launch" file at the top level of your project.

Eclipse Workspace Update

Collecting coverage information for unit tests requires registering extra debugger actions.

  1. In e2 studio, go to Window> Preferences> C/C++> Debug> GDB.
  2. Modify the value of GDB Command by browsing for the gdb script located in <path_to_install_location>\engine\etc\templates\for_recipes\RenesasRxGDBinit.gdb
  3. If a GDB Command is already specified, append the contents of the script from the above location to the script that is already registered.

The gdb script is set to exit the debugger at Excep_BRK(). If the program being executed halts in a different manner, modify the gdb script accordingly.

Updating Project Properties

Unit testing with C++test requires optimization be set to 0:

  1. Open the project properties and go to C/C++Build> Settings.
  2. Expand the submenu of the C and C++ Compiler and click Optimize.
  3. Select 0 in the Optimize level field.


Open the project properties and go to Parasoft> C++test> Build Settings and configure the following options:

  • Options source
    Select Use Options from Managed Make C/C++ project from the drop down menu.
  • Compiler Settings
    Select Renesas RX C/C++ Compiler 2.5x from the Family drop-down menu and click OK when prompted to confirm the changes.
  • Options
    Set the Compiler options to ${cpptest:original_options} -define=PARASOFT_CPPTEST -define=FILE_COMMUNICATION_BUFFER_SIZE=128.
    Append Linker options with the start argument available in ${workspace_loc}\Debug\LinkerSubCommand.tmp. Your -start argument may resemble the following:  -start=SU,SI,B_1,R_1,B_2,R_2,B,R/04,PResetPRG,C_1,C_2,C,C$*,D*,W*,L,PIntPRG,P/0FFD00000,EXCEPTVECT/0FFFFFF80,RESETVECT/0FFFFFFFC

Setting up an Instrumented Debug Launch Configuration

  1. Duplicate the default debug launch configuration. The new configuration will be placed at the top level directory of a new project created with e2 studio.
  2. Ensure that the duplicated configuration produces a debug executable that can be run with the debugger supplied with e2 studio.
  3. Rename the new debug launch configuration to indicate it can be used for unit testing with C++test.
  4. Customize the configuration.
    In the Startup tab:
    - Disable the Halt checkbox.
    - Disable the Set breakpoint at checkbox.
    - Enable the Resume checkbox.

    In the Debugger> Debug Tool Settings tab:
    - In the Memory section, click the ellipsis button in the Memory Areas row.
    - Add a new Emulation ROM address space to the map of at least 1MB.
    - Modify the start argument to use the start address of this new memory space fo the Program area {P}.

Example of start argument modification

For the new Simulator Memory Map Row:

Emulation ROM0x010000000x01ffffff16384 KBytes

The original project link command start argument:

-start=SU,SI,B_1,R_1,B_2,R_2,B,R/04,PResetPRG,C_1,C_2,C,C$*,D*,W*,L,PIntPRG,P/0FFFF0000,FIXEDVECT/0FFFFFF80

The Parasoft link options after update:

-start=SU,SI,B_1,R_1,B_2,R_2,B,R/04,PResetPRG,C_1,C_2,C,C$*,D*,W*,L,PIntPRG,P/001000000,FIXEDVECT/0FFFFFF80

It may be necessary to make room for more Uninitialized D

Allocating more space for uninitialized data

You may need to make more room for uninitialized data in the following cases:

  • The amount of heap space of an instrumented executable exceeds the amount of RAM provided by default.
  • The program fails to link due to errors stating that a given address overruns its given section.

To update the memory map, follow the steps from Setting up an Instrumented Debug Launch Configuration and add a new Emulation RAM section (instead of Emulation ROM).

For the new Simulator Memory Map Row:

Emulation RAM0x020000000x02ffffff16384 KBytes

Modify the start argument of the Parasoft linker options to reflect the new row in the memory map.

The original project link command start argument:

-start=SU,SI,B_1,R_1,B_2,R_2,B,R/04,PResetPRG,C_1,C_2,C,C$*,D*,W*,L,PIntPRG,P/001000000,FIXEDVECT/0FFFFFF80

The Parasoft link options after update:

-start=SU,SI,R_1,R_2,R/04,PResetPRG,C_1,C_2,C,C$*,D*,W*,L,PIntPRG,P/001000000,FIXEDVECT/0FFFFFF80,B_1,B_2,B/002000000


It may also be necessary to update the values for stack and heap size. They are defined by #define HEAPSIZE and #pragma stacksize su.


Example Workflow for setting up Application Monitoring

Exclude source files that contain system initialization or interrupt code from Parasoft instrumentation:

  1. Right-click one source file or a group of selected source files and go to Parasoft> C++test> Execution Settings... .
  2. Disable the Instrument selected source file(s) option in the dialog box.

This does not apply to header files.


The C++test execution flow for application monitoring needs to point to the customized launch configuration. To set up the configuration:

  1. Choose Parasoft in the IDE menu bar.
  2. Go to Test Configurations...> Builtin> Embedded Sysems> Renesas Rx.
  3. Duplicate the Build and Run Renesas Rx Application Monitoring Executable in e2 Studio configuration. The duplicated configuration will be displayed in the User-defined category.
  4. Open the duplicated configuration and click the Execution> Runtime tab.
  5. Enable the Run tests in debugger(*) checkbox.
  6. Enable the Use Eclipse internal debugger with configuration: option and select the new debug launch configuration from the drop-down menu.


  • No labels