Debug by attaching to a process

If you're connecting to your target machine by IP, you can use the BlackBerry Tablet OS Attach to Running Application configuration to connect to a remote process that's already running. Your target must be running qconn .

Before you begin:

Your application must already be running on the device or simulator to attach to its process. Also, ensure that either the device or simulator that you want to use is in Development mode.

To enable Development Mode if it is not currently set:

  1. Connect to the device.
  2. Click the Setting icon.

    The Setting icon.

  3. Select Security in the left navigator.
  4. Select Development Mode from the list of security options.
  5. Next to the Use Development Mode label, set the Development Mode setting to ON.
  6. In the Device password field, type the password for your device, and click Return.
  7. Click Back.
  8. On the home screen of the device, to verify that the Development Mode was set, verify that the Development Mode icon is displayed at the top:

    The Development Mode icon.

To debug an application by attaching to a process:
  1. Select a project from the Project Explorer.
  2. Right-click on the project and select the Device-Debug variant from Build Configurations > Set Active > Device-Debug .
  3. Optional: Navigate to some statements in your code, such as in main.c, that you can add breakpoints to.
  4. Right-click on the project from the Project Explorer and click Build Project.
  5. Right-click on the project and select Debug As > Debug Configurations .
  6. Create a debug launch configuration of type BlackBerry Tablet OS Attach to Running Application by selecting the type and then clicking New.
  7. On the Debugger tab, under the Debug Options of the Main page, click Browse opposite the GDB Debugger field, and then specify the path to the location of the gdb file to use, such as ${HOME}\win32\x86\usr\bin\ntoarm-gdb.exe.
  8. Click Debug to start the debug process.
  9. In the Select Process Verify dialog, select a running process.
    The debug session starts.
  10. In Debug view, click Resume.
    Verify that the application is running.
  11. If you specified one or more breakpoints earlier, the IDE should encounter a breakpoint.
  12. Verify that the IDE encountered the breakpoint.
  13. Click Resume to continue debugging.
  14. Click Disconnect.
    The debug session is terminated but the process continues to run.