Debugging a C/C++ app
When you debug your app using the toolbar in the Momentics IDE for BlackBerry, you select the Debug launch mode and a launch target to debug your app on. The Momentics IDE builds your app with the corresponding build configuration (either Device-Debug or Simulator-Debug) and then launches your app with the selected configuration. You don't need to build the app, configure the build configuration, or configure the launch configuration, because the Momentics IDE completes these tasks for you.
The debugging controls appear in the Debug view toolbar, the right-click context menu, and the Run menu. To debug your app:
- On the toolbar, in the Launch configuration drop-down list, click a launch configuration.
- In the Launch mode drop-down list, click Debug.
- In the Launch target drop-down list, click a device or simulator.
- To resolve any device connection issues, click Edit, and follow the instructions in the Device Properties dialog box.
- Click . The Momentics IDE changes to the Debug perspective, installs the app on your simulator or device, and starts the app under the control of the debugging tool. The debugging tool stops at the first line of your code and waits for your input.
- In the Debug view, click the thread that you want to control.
- To control the debugging tool, use the buttons in the Debug view toolbar.
- When you are finished debugging, on the Debug view toolbar, click . You must terminate the debug session before you rebuild the project, or the build fails.
Control your debug session using the C/C++ editor
To control your debug session using the C/C++ editor, you allow the app to run until it hits the line that your cursor is on. If the app never hits that line, the app runs until it finishes or hits another breakpoint. You can use the context menu in the C/C++ editor to resume execution at a specific line or to add a watch expression.
The debugging tool controls the debugging session in the C/C++ editor.
- In the editor, select a file that is associated with the process that you are debugging.
- Click where you want to insert the cursor and interrupt the execution.
- Right-click near the cursor and click Run To Line, Resume at line,
or Add watch expression.
Run To Line works only in the current stack frame, which means that you can use it only within the function that is running.
Last modified: 2015-03-31