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.
Before you begin
For a Linux kernel module debug, a Remote Systems Explorer (RSE) connection to the target might be required. If so, you must know the target IP address or name.
From the Arm Development Studio main menu, select.
In the Hardware Connection dialog, specify the details of the connection:
In Debug Connection give the debug connection a name, for example my_linux_kernel_connection and click Next.
In Target Selection select a target, for example
Juno Arm Development Platform (r2)and click Finish to complete the initial configuration of the connection.
In the Edit Configuration dialog, use the Connection tab to specify the target and connection settings:
- In the Select target panel, browse and select Linux Kernel and/or Device Driver Debug operation, and further select the processor core you require.
- Select your debug hardware unit in the Target Connection list. For example, DSTREAM Family.
- If you need to, Edit the Debug and Trace Services Layer (DTSL) settings in the DTSL Configuration Editor to configure additional debug and trace settings for your target.
- In the Connections area, enter the Connection name or IP address of your debug hardware adapter. If your connection is local, click Browse and select the connection using the Connection Browser.
Use the Files tab to specify your application and additional resources to download to the target:
- If you want to load your application on the target at connection time, in the Target Configuration area, specify your application in the Application on host to download field.
- If you want to debug your application at source level, select Load symbols.
- If you want to load additional resources, for example, additional symbols or peripheral description files from a directory, add them in the Files area. Click Add resource to add resources, click Remove resources to remove resources.
Select the Run control area in the Debugger tab to configure debugger settings:
Select Connect only and set up initialization scripts as required.
Operating System (OS) support is automatically enabled when a Linux kernel
vmlinuxsymbol file is loaded into the debugger from the Arm 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 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.
Select Execute debugger commands option.
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
- The path to the
vmlinuxmust be the same as your build environment.
- In the example above, the kernel image is called
vmlinux, but this could be named differently depending on your kernel image.
- In the example above,
S:0loads the symbols for secure space with
0offset. 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.
- The path to the
The debugger uses your workspace as the default working directory on the host. If you want to change the default location, deselect the Use default option under Host working directory and specify a new location.
In the Paths area, specify any directories on the host to search for files of your application using the Source search directory field.
If you need to use additional resources, click Add resource (+) to add resources, click Remove resources (-) to remove resources.
If required, use the Arguments tab to enter arguments that are passed to the
main()function of the application when the debug session starts. The debugger uses semihosting to pass arguments to
If required, use the Environment tab to create and configure environment variables to pass into the launch configuration when it is executed.
Click Apply to save the configuration settings.
Click Debug to connect to the target and start the debugging session.
By 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.