Example 3: Loading multiple images

nRF Connect for VS Code

tags
nRF Connect for VS Code

Use inferiors to load several images that run on the same processor into one GDB session. Set entryPoint only for the images at whose entry points the debugger must stop.

Debug multiple images on one processor
{
    "configurations": [
        {
            "type": "nrf-debug",
            "request": "launch",
            "name": "Launch application and MCUboot",
            "config": "${activeConfig}",
            "inferiors": [
                {
                    "elfFile": "${activeConfig}/zephyr/zephyr.elf",
                    "entryPoint": "main"
                },
                {
                    "elfFile": "${activeConfig}/mcuboot/zephyr/zephyr.elf"
                }
            ]
        }
    ]
}

When you start debugging the top build configuration of a sysbuild application from the Actions View, the extension creates the inferiors configuration automatically from your processor and stop-point selections. When you start debugging a single sysbuild domain instead, the extension also adds the other images that run on the same processor, such as MCUboot. In both cases, the extension skips images that do not support debugging and adds the Trusted Firmware-M image, if present, without an entry point, so that its symbols are available during debugging.