In this section:

You can create a test configuration to run the GNU project debugger (gdb) outside of Eclipse:

  1. Open the Test Configurations window and duplicate the Built-in> Unit Testing> Debug Unit Tests.
  2. Select the new User-defined Test Configuration and change the name to Debug Unit Tests -gdb.
  3. Open the Execution> Runtime tab and confirm that Run tests in debugger is selected.
  4. Select Apply and Close.

GNU gdb 7.3 Debugger Workaround

Due to a problem in GNU gdb 7.3, C++test cannot successfully use the debugger on Windows. Use the following workaround if you are using GNU gdb 7.3 debugger:

  1. Choose Parasoft> Preferences> Technical Support.
  2. Select Advanced options and enter:
    CPPTEST_BREAKPOINT_PATH_MODIFIER_CMDLINE=cygpath

  3. Apply changes and click OK.
    This workaround will only work if the cygpath utility is available. See the Cygwin documentation for more information.

  4. Ensure that the Eclipse debugger is configured to work with the project:
    1. Open the project properties.
    2. Go to C/C++Build > Settings.
    3. Enable the appropriate options under Binary parsers, depending on your system (e.g., GNU Elf Parser or Cygwin PE Parser) and click OK.
  5. In the Test Cases Explorer, select the Test_Suite_ATM_cxx... -> test_viewAccount_1 test case.
  6. Run the 'Debug Unit Tests - gdb' configuration. The test case will be executed and a gdb debugger window will open and break at the beginning of the test case.



  7. Use the debugger controls to step through code and debug issues.

 

Run GDB Inside the Eclipse IDE

  1. Create an "Eclipse debug" Test Configuration:
    1. Open the Test Configurations window and duplicate the Built-in> Unit Testing> Debug Unit Tests.
    2. Select the new User-defined Test Configuration and change the name to Debug Unit Tests - gdb Eclipse.
    3. Open the Execution> Runtime tab and select Debug directly in Eclipse IDE using configuration.

    4. Apply changes and close the Test Configurations window.
  2. Select a test case in the Test Case Explorer and run Parasoft> Test Using> User-Defined> Debug Unit Tests - gdb Eclipse.
  3. Click Yes when prompted to switch to the debug perspective.
  4. If you receive an error stating that the source file can not be found, you will need to edit the path mapping settings for the Cygwin:
    1. Select Edit Source Lookup Path.
    2. Click Add to add a lookup path.
    3. Select Path Mapping and click OK.
    4. Click Add and enter the mapping information as shown below:

    5. Click OK to accept the Lookup Path changes.
  5. If you have an Eclipse configuration, you can enter it in the C++test Test Configuration created in step 1 above for future debug runs.
  6. Use the debugger controls to step through code and debug issues.
  • No labels