Debugging a Symbian OS Program on the S60 Emulator

## Debugging a Symbian Program

Use the Carbide.c++ debugger to debug a compiled Symbian program in an emulator or on-device. The same process works for other emulators and target devices as well.

NOTE This example uses the Symbian Emulator included with the Symbian^3 SDK. The steps are identical for on-device debugging, although a .sym file is not needed for emulator builds.

#### Debugging a Symbian program

NOTE You can only debug compiled programs. Use the Build Project command to compile project sources into a binary file if you do not already have an executable in the project. A symbolics (.sym) file is also required for debugging on a target device. Ensure that a .sym file has been created. If you are importing an existing application, you may have to rebuild the application and create a related .sym file. Make sure a .sym file has been created in the output directory.

1. Set a breakpoint in the MyProject program

Open the \src\OortCloudAppUI.cpp file and set a breakpoint in the HandleCommandL routine.

Figure 1 - Breakpoint set in COortCloudAppUI::HandleCommandL routine.

2. Launch the Carbide debugger and Symbian Emulator

Start the Carbide debugger which launches the Symbian Emulator, then installs and launches the executable. For on-device debugging, the application is installed on the target device.

The OortCloud application launches (Figure 2).

Figure 2 - OortCloud application running on Symbian Emulator

NOTE For SDKs prior to the S60 5th Edition it may be necessary to locate the installed application and manually launch it in the emulator or on the target device.

3. Click the Options soft-key on the Symbian Emulator to display the Options menu.
4. Choose the Message menu item and press the Select soft-key to send a message (Figure 3).

Figure 3 - Send Message to OortCloud application

The HandleCommandL breakpoint is hit in the program and control returns to the Carbide debugger (Figure 4). You can now set additional breakpoints, examine variables, or use the Debug view buttons to control the program.

Figure 4 - Back in the COortCloudAppUI::HandleCommandL routine

That's it for this basic introduction to debugging with Carbide.c++.

##### Concepts

- Projects

##### Tasks

- Creating Projects
- Building Projects
- Creating a Launch Configuration