Before you can use Eclipse to debug your application, you must decide which debugging mode to use. The debugging mode to use depends on your choice of target system, and, in some cases, on the way that you have built your application.
Sourcery G++ supports several debugging modes, as described below. Some modes are available only in certain versions of Sourcery G++, so there may be modes listed in this section that are not available to you.
The Embedded mode is designed for use with target systems that have no operating system support for debugging. In the Embedded mode, Sourcery G++ connects to a "GDB stub" running on either the target system or on a host system. You must start the stub manually.
When you debug your application in the Embedded mode, Eclipse
will load the application on your target system, set the
program counter to the address of the
_start
function, and then begin
execution.
The ROM mode is like the Embedded mode, but should be used for applications that are stored in ROM (or flash memory) on the target system. In this mode, Sourcery G++ will use hardware breakpoints, since the program image cannot be modified. Therefore, there will probably be a limit on the total number of breakpoints you can create.
Some debugger operations (such as stepping over a function call) will not work correctly in the ROM mode because the debugger is unable to set software breakpoints.
On UNIX-like operating systems (including GNU/Linux) Sourcery G++ includes a program called gdbserver which can be used for remote debugging. The Server mode allows you to connect to an already-executing gdbserver.
In the Simulator mode, Sourcery G++ will use the instruction-set simulator provided with Sourcery G++. You do not need target hardware in order to use this mode.
After you build your application, choose C/C++ Local Application label in the Configurations pane and click .
from the menu. Select theOn the Main tab, use the button to select your project, if it is not already selected. Use the button to select your application. Then, switch to the Debugger tab. Select the Sourcery G++ debugger appropriate for your target. Then, click the button.
You do not need to repeat this process the next time you launch the debugger. Instead, you can select
from the menu to start the debugger.