

使用VSC调试开源项目 – iproute2
source link: https://www.taterli.com/9510/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

使用VSC调试开源项目 – iproute2
使用VSC调试开源项目 – iproute2
使用VSC阅读代码有非常舒服的感觉,如果能再加上调试,那就更爽了,而很多开源项目本身也比较大,直接阅读代码还是有点困难的,所以最好还是上调试,调试也很简单,无非是调用gdb,所以先新建一个简单的任务tasks.json,用来指代编译过程,具体根据项目而定.
{
"tasks": [
{
"type": "shell",
"label": "Makefile",
"command": "make",
"problemMatcher": [],
}
],
"version": "2.0.0"
}
接着创建launch.json,来指代要调试的内容,比如假设我这里要看的是iproute2中的ip -6 address命令,那么就写下来.
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/ip/ip",
"args": ["-6","address"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Makefile"
}
]
}
最后按F5,顺利进入调试.

可以说非常简单了.
Recommend
-
56
-
49
前言 大家都是出来写代码的,少不了要写上千万来行代码,其中重复性的代码占比又会很大。那么如何避免一次又一次写重复性的代码这无聊的事情呢?除了代码自身的优雅、可复用,Jetbrains系如Intellij IDEA的 Live Templa...
-
8
美化windows下的VSC:通过集成 cmder 来使用 zsh create: 2020-08-06 11:55:01 | update: 2020-08-06 11:55:01 本文总阅读量: 51 次 | 文章总字数: 277 字 | 阅...
-
9
utilities for TCP/IP networking in LinuxThis ip command guide is a follow-up of my previous 90 Linux Commands frequently used by Linux Sys...
-
10
VSC在Windows下通过WSL调试Node程序 作者: liesauer...
-
8
现在带公司内 Go 的开发工具中 VSC 和 Goland 哪个更流行呢? V2EX › Go 现在带公司内 Go 的开发工具中 VSC 和 Goland 哪个更流行呢...
-
8
VSC HardFault 调试由 TaterLi2022年2月18日2022年2月18日 VSC的调试HardFault和普通寄存器没区别,所以挨个看. SCB...
-
5
有迹可循么,有遇到过类似问题的兄弟的吗? 这是正常的代码提示 这是抽风了的代码提示 2 条回复 •...
-
6
VSC + Wavefrom Render 画时序图 – TaterLi 个人博客 VSC + Wavefrom Render 画时序图 ...
-
8
CMSIS-DAP + VSC 开发调试 RP2040 CMSIS-DAP + VSC 开发调试 RP2040...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK