-
Notifications
You must be signed in to change notification settings - Fork 1
[QEMU macOS] Integrating to VSCode
Antonio Giacomelli edited this page Jun 13, 2025
·
34 revisions
This page describes how to debug RK0 using QEMU and VSCodium (or VS Code*) on macOS.
brew install arm-none-eabi-gcc
brew install qemu
Run from the RK0 project root:
make ARCH=armv7m
To debug:
make qemu-debug
This will start QEMU and open a GDB server on localhost:1234
.
{
"version": "2.0.0",
"tasks": [
{
"label": "Build RK0 for ARMv7-M",
"type": "shell",
"command": "make ARCH=armv7m",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Start QEMU in Debug Mode",
"type": "shell",
"command": "make qemu-debug",
"isBackground": true,
"problemMatcher": {
"pattern": {
"regexp": "."
},
"background": {
"activeOnStart": true,
"beginsPattern": "Start GDB with:",
"endsPattern": "localhost:1234"
}
}
}
]
}
PS: On macOS, the
cppdbg
debugger type often fails to attach to GDB/LLDB. I use thecortex-debug
only. I can't say if using pure VSCode (and not VSCodium as I do) would solve the issue.
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug RK0 - ARMv7M",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/build/armv7m/rk0_demo.elf",
"request": "attach",
"type": "cortex-debug",
"servertype": "external",
"gdbTarget": "localhost:1234",
"gdbPath": "arm-none-eabi-gdb",
"device": "Cortex-M3",
"runToEntryPoint": "main",
"preLaunchTask": "Start QEMU in Debug Mode"
}
]
}
- Build and start QEMU in the background using the Run Panel.
- Launch the Debug configuration — VSCodium will attach to GDB server.
Copyright (C) 2025 Antonio Giacomelli | www.kernel0.org