VSCode 中调试带 Makefile 文件的项目

在调试 QEMU 时,自己需要修改源文件,但是每次修改都需要在命令行重新make编译一遍,比较麻烦,想到之前刚刚配置过tasks.json文件,可以把命令行任务配置到文件里,make命令不也一样可以加入吗?修改tasks.json文件如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
"version": "2.0.0",
"tasks": [
{
//任务的名字方便执行
"label": "make qemu",
"type": "shell",
"command": "make",
"args":[
//8 线程编译
"-j8",
],
"options": {
//切换到 build 文件夹下
"cwd": "${workspaceFolder}/build"
},
},
{
// 启动 qemu 供调试器连接
"type": "shell",
"label": "Run Qemu Server(RISCV)",
//在执行这个任务前,先执行 make qemu 任务、
//这样就可以在执行调试时,自动先编译一遍
"dependsOn": "make qemu",
"command": "qemu-system-riscv64",
"args": [
"-g",
"${workspaceFolder}/debug/${fileBasenameNoExtension}"
],
},
]
}
解决 expected 'char * const*' but argument is of type 'char **' 解决 gcc-multilib : 依赖:gcc-4.8-multilib (>= 4.8.2-5~) 但是它将不会被安装
You need to set install_url to use ShareThis. Please set it in _config.yml.

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×