You copied the Doc URL to your clipboard.

Configuring a connection to a Linux application using gdbserver

For Linux application debugging, you can configure Arm® Debugger to connect to a Linux application using gdbserver.

Prerequisites

  • Set up your target with an Operating System (OS) installed and booted. Refer to the documentation supplied with your target for more information.
  • Obtain the target IP address or name for the connection between the debugger and the debug hardware adapter. If the target is in your local subnet, click Browse and select your target.
  • If required, set up a Remote Systems Explorer (RSE) connection to the target.

Note

  • If you are connecting to an already running gdbserver, then you must ensure that it is installed and running on the target. To run gdbserver and the application on the target use: gdbserver port path/myApplication. Where port is the connection port between gdbserver and the application and path/myApplication is the application that you want to debug.
  • If you are connecting to an Armv8 target, select the options under Connect via AArch64 gdbserver.

Procedure

  1. From the Arm Development Studio main menu, select File > New > Linux Application Connection.
  2. In the Linux Application Connection dialog, specify the details of the connection:
    1. Give the debug connection a name, for example my_linux_app_connection.
    2. If using an existing project, select Use settings from an existing project option.
    3. Click Finish.
  3. In the Edit Configuration dialog displayed:
    • If you want to connect to a target with the application and gdbserver already running on it:

      1. In the Connection tab, select Connect to already running application.
      2. In the Connections area, specify the address and port details of the target.
      3. If you want to terminate the gdbserver when disconnecting from the FVP, select Terminate gdbserver on disconnect.

        Figure 6-4 Edit Linux app connection details

        Edit Linux app connection details

      4. In the Files tab, use the Load symbols from file option in the Files panel to specify symbol files.
      5. In the Debugger tab, specify the actions that you want the debugger to perform after connecting to the target.
      6. If required, click the Arguments tab to enter arguments that are passed to the application when the debug session starts.
      7. If required, click the Environment tab to create and configure the target environment variables that are passed to the application when the debug session starts.
    • If you want to download your application to the target system and then start a gdbserver session to debug the application, select Download and debug application. This connection requires that ssh and gdbserver is available on the target.

      1. In the Connections area, specify the address and port details of the target you want to connect to.
      2. In the Files tab, specify the Target Configuration details:

        • Under Application on host to download, select the application to download onto the target from your host filesystem or workspace.
        • Under Target download directory, specify the download directory location.
        • Under Target working directory, specify the target working directory.
        • If required, use the Load symbols from file option in the Files panel to specify symbol files.
      3. In the Debugger tab, specify the actions that you want the debugger to perform after it connects to the target.
      4. If required, click the Arguments tab to enter arguments that are passed to the application when the debug session starts.
      5. If required, click the Environment tab to create and configure the target environment variables that are passed to the application when the debug session starts.
    • If you want to connect to your target, start gdbserver, and then debug an application already present on the target, select Start gdbserver and debug target resident application, and configure the options.

      1. In the Model parameters area, the Enable virtual file system support option maps directories on the host to a directory on the target. The Virtual File System (VFS) enables the FVP to run an application and related shared library files from a directory on the local host.

        • The Enable virtual file system support option is selected by default. If you do not want virtual file system support, deselect this option.
        • If the Enable virtual file system support option is enabled, your current workspace location is used as the default location. The target sees this location as a writable mount point.
      2. In the Files tab, specify the location of the Application on target and the Target working directory. If you need to load symbols, use the Load symbols from file option in the Files panel.
      3. In the Debugger tab, specify the actions that you want the debugger to perform after connecting to the target.
      4. If required, click the Arguments tab to enter arguments that are passed to the application when the debug session starts.
      5. If required, click the Environment tab to create and configure the target environment variables that are passed to the application when the debug session starts.
  4. Click Apply to save the configuration settings.
  5. Click Debug to connect to the target and start debugging.