2.7 Configuring a connection to a Linux kernel

Use these steps to configure a connection to a Linux target and load the Linux kernel into memory. The steps also describe how to add a pre-built loadable module to the target.

Prerequisites

Before connecting, you must:
  • Obtain the target IP address or name for the connection between the debugger and the debug hardware adapter.
  • If required, set up a Remote Systems Explorer (RSE) connection to the target.

Procedure

  1. Select Window > Open Perspective > DS-5 Debug from the main menu.
  2. Select Debug Configurations... from the Run menu.
  3. Select DS-5 Debugger from the configuration tree and then click on New to create a new debug configuration.
  4. In the Name field, enter a suitable name for the new debug configuration.
  5. Click on the Connection tab to configure a DS-5 Debugger target connection:
    1. Select the required platform, Linux Kernel and/or Devices Driver Debug project type and the required debug operation.
    2. Configure the connection between the debugger and the debug hardware adapter.
  6. Click on the Debugger tab to configure the debugger settings.
    1. In the Run control panel, select Connect only and set up initialization scripts as required.

      Note

      Operating System (OS) support is automatically enabled when a Linux kernel vmlinux symbol file is loaded into the debugger from the DS-5 Debugger launch configuration. However, you can manually control this using the set os command.
      For example, if you want to delay the activation of operating system support until after the kernel has booted and the Memory Management Unit (MMU) is initialized, then you can configure a connection that uses a target initialization script to disable operating system support.
    2. Select the Execute debugger commands option.
    3. In the field provided, enter commands to load debug symbols for the kernel and any kernel modules that you want to debug, for example:
      add-symbol-file <path>/vmlinux S:0 
      add-symbol-file <path>/modex.ko 

      Note

      • The path to the vmlinux must be the same as your build environment.
      • In the above example, the kernel image is called vmlinux, but this could be named differently depending on your kernel image.
      • In the above example, S:0 loads the symbols for secure space with 0 offset. The offset and memory space prefix is dependent on your target. When working with multiple memory spaces, ensure that you load the symbols for each memory space.
    4. Configure the host working directory or use the default.
    5. In the Paths panel, specify any source search directories on the host that the debugger uses when it displays source code.
  7. Click on Apply to save the configuration settings.
  8. Click on Debug to connect to the target.
  9. Debugging requires the DS-5 Debug perspective. If the Confirm Perspective Switch dialog box opens, click Yes to switch perspective.
When connected and the DS-5 Debug perspective opens, you are presented with all the relevant views and editors.
For more information on these options, press F1 on your keyboard to display dynamic context help.

Tip

HandBy default, for this type of connection, all processor exceptions are handled by Linux on the target. Once connected, you can use the Manage Signals dialog box in the Breakpoints view menu to modify the default handler settings.
Related concepts
6.10.2 About debugging a Linux kernel
6.10.3 About debugging Linux kernel modules
6.7 About debugging bare-metal symmetric multiprocessing systems
Related tasks
2.5 Configuring a connection to a Fixed Virtual Platform (FVP) model for Linux application debug
2.6 Configuring a connection to a Linux application using gdbserver
2.3 Configuring a connection to a bare-metal hardware target
2.10 Configuring an Events view connection to a bare-metal target
Related reference
11.38 Debug Configurations - Connection tab
11.39 Debug Configurations - Files tab
11.40 Debug Configurations - Debugger tab
11.41 Debug Configurations - OS Awareness tab
11.42 Debug Configurations - Arguments tab
11.43 Debug Configurations - Environment tab
11.48 Target management terminal for serial and SSH connections
12.1 ARM Linux problems and solutions
12.3 Target connection problems and solutions
Related information
Debugging a loadable kernel module
Non-ConfidentialPDF file icon PDF versionARM DUI0446W
Copyright © 2010-2015 ARM. All rights reserved.