vscode使用笔记
Debug: attach到某个进程
安装插件:WebFreak的Native Debug
在.vscode/launch.json里:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to PID",
"type": "gdb",
"request": "attach",
"target": "要attach到的PID",
"cwd": "${workspaceRoot}",
"valuesFormatting": "parseText"
}
]
}
Debug: 连接到gdbserver
安装插件:WebFreak的Native Debug
gdbserver :2345 /path/to/executable args...
在.vscode/launch.json里:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to port",
"type": "gdb",
"request": "attach",
"executable": "/path/to/executable",
"target": ":2345",
"cwd": "${workspaceRoot}",
"remote": true,
// "stopAtConnect": true,
}
],
}
然后按F5即可连接到gdbserver。
只对特定语言开启保存时自动格式化
例如只对js开启保存时自动格式化:
"[javascript]": {
"editor.formatOnSave": true
}
Language Identifiers: https://code.visualstudio.com/docs/languages/identifiers
补充:
| Language Identifier | 含义 |
|---|---|
| cmake | CMakeLists.txt |
| jsonc | JSON with Comments |
| markdown | Markdown |
切换字体
默认的字体不行,1和l都分不清。可以在Editor: Font Family里更改字体,推荐Hack:
'Hack', 'monospace', monospace

浙公网安备 33010602011771号