Debugging eCos applications

Setup

Prior to debugging an eCos application, it is necessary to generate a suitable Eclipse debug configuration. The debug configuration specifies the name of the executable file and how the contents of this file may be downloaded to the remote target and launched. To create a debug configuration, invoke the Debug dialog box using the Run->Open Debug Dialog... menu item. Select C/C++ Local Application, click on the New launch configuration icon to create the new configuration and then give it a meaningful name such as "ARM target on /dev/ttyS1". Then proceed with the following steps:

On Windows-hosted installations, it is also necessary to specify a path mapping for POSIX-style file paths before debugging. Invoke the Preferences dialog box using the Window->Preferences... menu item and select the C/C++->Debug->Common Source Lookup Path item from the tree of preferences. Click Add... and choose Path Mapping. A new path mapping entry will immediately appear in the Common Source Lookup Path tree. Click Edit... to modify this item, give the path mapping a meaningful name such as "Cygwin root" and then click Add... to specify the mapping paths. Enter a single forward slash character ("/") as the Compilation path and browse to the Local file system path directory corresponding to the POSIX-style root directory (typically C:\cygwin). This path mapping ensures that the POSIX-style source code references in eCos application executable files are interpreted correctly by CDT.

Hardware debuggers

When using hardware debuggers such as those using a JTAG or BDM interface, it may be necessary to override the default behaviour of CDT for launching a debugging session. For example, an external tool may be required to install code into Flash memory prior to debugging. The eCosCentric plug-ins allow the user to perform such customisation by specifying a GDB command file on the Main pane of the Debug dialog box. The following optional GDB macros may be defined within the GDB command file: