8.2.5. Connections to a target OS using gdbserver (GDBserver)

If your target application requires TCP/IP communication with the debug host, you must connect to the target using bridged Ethernet. Connections of this type are referred to as GDBserver connections. This method is an extension to that described in Connections to a target with a GDB stub (Target-GDB), shown in Figure 8.4. In this method, IP packets can be carried over the same link alongside the normal GDB protocol.

Figure 8.4. GDBserver connections


GDBserver Scenario

Use the GDBserver connection method to debug an application on a target that has an embedded OS, such as Linux, that supports independent processes. In this case you can run GDB server (gdbserver) instances. The GDB server can have TCP/IP connections to the debug host that is running GDB. The DCC driver is available as a Linux OS download from the ARM website: http://www.arm.com/products/.

GDBserver Requirements

To use the GDBserver connection method:

  • On the GDB connection to the target, you must enable DCC and Virtual Ethernet/TTY mode before starting the processor (see Setting DCC parameters).

  • The target OS must be running an TCP/IP stack and gdbserver.

  • RealView ICE acts as a network bridge between the target processor and the host PC using a virtual Ethernet link. The target must have its own IP address that is either fixed or obtained from a DHCP server, and that appears on the virtual Ethernet as an independent host.

Procedure for debugging an application using a GDBserver connection

If your application uses an IP stack, it can communicate over DCC through a bridged Ethernet connection.

To debug an application using a GDBserver connection:

  1. Power up your target hardware and RealView ICE unit.

  2. Download and boot the target using the rviload utility (see Loading and booting a complete system).

  3. When the Linux kernel has finished booting, start the gdbserver as follows:

    ~ # gdbserver localhost:portnum filename
    

    The TCP/IP port number you specify here is the port number you must use with the GDB target remote command from subsequent GDB sessions. Also, make sure the port number is not in use by another service.

Copyright © 2002, 2004-2008 ARM Limited. All rights reserved.ARM DUI 0155J
Non-Confidential