远程调试linux 系统/单板配置
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/code/prj/linux/demo",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"miDebuggerPath":"/usr/local/arm/arm-linux-gnueabihf-5.5.0/bin/arm-linux-gnueabihf-gdb",
"miDebuggerServerAddress": "192.168.1.55:1234"
}
]
}
本地调试linux配置
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "local gdb",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/code/prj/linux/demo",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
说明
program
要调试的程序名(包含路径,可以使用环境变量+相对路径)miDebuggerServerAddress
服务器的地址和端口 cwd
调试程序的路径miDebuggerPath
gdb 的路径