VSCode integration
Debug Linux kernel within Visual Studio Code
Create configuration files
Create tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Build Kernel for ARM",
"type": "shell",
"command": "make",
"args": [
"ARCH=arm",
"CROSS_COMPILE=arm-linux-gnueabihf-",
"-j6"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "Copy zImage",
"command": "cp",
"args": [
"arch/arm/boot/zImage",
"../emulation/boot/efi/boot/bootarm.efi"
],
"dependsOn":["Build Kernel for ARM"]
},
{
"label": "Run qemu",
"command": "/usr/bin/qemu-system-arm -m 1024 -cpu cortex-a15 -M virt -pflash flash0.img -pflash flash1.img -nographic -drive file=fat:rw:boot/ -smp '4' -s",
"options": {
"cwd": "${workspaceFolder}/../emulation"
},
"type": "shell",
"isBackground": true,
"problemMatcher": [
{
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": ".",
"endsPattern": ".",
}
}
],
"dependsOn":["Copy zImage"]
},
{
"label": "Terminate All Tasks",
"command": "echo ${input:terminate}",
"type": "shell",
"problemMatcher": []
}
],
"inputs": [
{
"id": "terminate",
"type": "command",
"command": "workbench.action.tasks.terminate",
"args": "terminateAll"
}
]
} Create launch.json
Create c_cpp_properties.json
Debug
Last updated
Was this helpful?