Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



How to set up remote debugging

Remote debugging has been validated for connection over IR and using a serial cable. Note that no other processes may use the serial port during a debugging session, e.g. Symbian connect.

The program to be debugged can be installed on the Symbian device using Symbian Connect or an Installation file, or the GDB rcopy command once GDB has been started.

To set up remote debugging on the host computer:

  1. Set up the communication link to the target device

    Connect either the serial cable or an IR pod to the selected comms port. GDB commands target epoc com and set remotebaud can then be used to open the specified serial port and to set the connection speed. These commands may be issued from the GDB command prompt, once GDB has started, but are usually included as part of the GDB initialisation file. The commands are defined in the Symbian specific GDB command reference and the GDB command summary.

  2. Create a GDB initialisation file (gdb.ini)

    The GDB initialisation file can be used to batch-execute a number of commands that would otherwise have to be manually entered at the host's (gdb) command prompt. Typically this file is created within the same directory as the project build file bld.inf. See How to configure the GDB initialisation file for more information.

  3. Start gdb.exe in the same directory as gdb.ini

    First open a command prompt in the directory containing the gdb.ini file. To start the command line GDB interface enter gdb -nw. To start the GUI GDB interface enter gdb. Once in the GUI, the console can be activated by selecting the menu option: View | Console.

  4. Install the program to be debugged on the Symbian device. This may be done using Symbian-connect, an Installation file, or the GDB rcopy command.

To set up remote debugging on the target device:

  1. Set up the communication link to the host computer

    Connect the Symbian device to the host through the serial cable, or by pointing its IR port at the host's IR pod.

  2. Install the GDB stub software

    Note that the software may already installed in the device ROM (Z:\System\Programs\). If not, it can be installed on any drive using the installation file provided with the SDK.

  3. Start the stub executable gdbstub.exe

    By default the stub is set up to use a serial cable attached to port 0, with the connection speed set to 115200 baud — this is the same default speed as GDB. The stub can be configured to other values, e.g. for connection via IR, using either command line arguments or a configuration file. See the GDB stub command line syntax and GDB configuration file syntax topics for more information.

    Note that the method used to start the GDB stub executable may need to be different on different devices. See the Symbian Developer Network for device-specific information.

See the topic How to close a debug session for information about how to close GDB and the GDB stub.