In this section:
You can create a test configuration to run the GNU project debugger (gdb) outside of Eclipse:
- Open the Test Configurations window and duplicate the Built-in> Unit Testing> Debug Unit Tests.
- Select the new User-defined Test Configuration and change the name to Debug Unit Tests -gdb.
- Open the Execution> Runtime tab and confirm that Run tests in debugger is selected.
- 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:
- Choose Parasoft> Preferences> Technical Support.
Select Advanced options and enter:
CPPTEST_BREAKPOINT_PATH_MODIFIER_CMDLINE=cygpath
Apply changes and click OK.
This workaround will only work if the cygpath utility is available. See the Cygwin documentation for more information.- Ensure that the Eclipse debugger is configured to work with the project:
- Open the project properties.
- Go to C/C++Build > Settings.
- Enable the appropriate options under Binary parsers, depending on your system (e.g., GNU Elf Parser or Cygwin PE Parser) and click OK.
- In the Test Cases Explorer, select the Test_Suite_ATM_cxx... -> test_viewAccount_1 test case.
- 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.
- Use the debugger controls to step through code and debug issues.
Run GDB Inside the Eclipse IDE
- Create an "Eclipse debug" Test Configuration:
- Open the Test Configurations window and duplicate the Built-in> Unit Testing> Debug Unit Tests.
- Select the new User-defined Test Configuration and change the name to Debug Unit Tests - gdb Eclipse.
- Open the Execution> Runtime tab and select Debug directly in Eclipse IDE using configuration.
- Apply changes and close the Test Configurations window.
- Select a test case in the Test Case Explorer and run Parasoft> Test Using> User-Defined> Debug Unit Tests - gdb Eclipse.
- Click Yes when prompted to switch to the debug perspective.
- 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:
- Select Edit Source Lookup Path.
- Click Add to add a lookup path.
- Select Path Mapping and click OK.
- Click Add and enter the mapping information as shown below:
- Click OK to accept the Lookup Path changes.
- 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.
- Use the debugger controls to step through code and debug issues.