Debug a program

Start a program in the debugger

The current program is defined in the Program Parameters dialog. See Run Parameters Dialog for more information. This program can be started in the debugger like this:

  1. From the main menu, select Run ▸ Debug Program or press Shift+F12

A program can be more difficult to debug if it is highly optimized or if debugging information is missing. Whether optimization and debugging information are enabled, is defined in the configure step. Normally, there is a Debug configuration available, that turns off optimization and includes all debugging information. Anjuta displays a warning if this configuration is not used. See Configure a project for more information.

Debug an already running application

The debugger can be used on an already running application.

  1. From the main menu, select Run ▸ Debug Process... to get a dialog listing all currently running processes.

  2. Select a process in the Attach to process dialog and click on Attach to start the debugger on this process. See Attach to Process Dialog for more details.

Debug a remote application

The debugger can be used to debug an application running on another computer connected through a TCP or serial connection.

  1. From the main menu, select Run ▸ Debug Remote...

  2. Select the type of the connection to the remote application, Serial Line Connection or TCP/IP Connection.

  3. For a TCP connection, fill in the Address and Port fields.

    For a serial connection, fill in the text box below with the serial device name, for example /dev/ttyb.

  4. Click on Connect to start the debugger and connect to the remote target.

Stop the debugger

The debugger and the program can be stopped at any time like this:

  1. From the main menu, select Run ▸ Stop Debugger.