visual-studio-code - VSCode dynamic processid in launch.json
问题描述
right now my launch.json file for debugging looks like this
{
// ${command:pickProcess}
"version": "0.2.0",
"configurations":
[{
"name": "(gdb) Attach",
"type": "cppdbg",
"request": "attach",
"program": "${workspaceFolder}/devel/lib/beginner_tutorials/talker",
"processId": "619",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]}
but the things is that I need to manually update the processid every time, is that possible that for the "processId", I can invoke some kind of script and return a pid in programmatic manner? ex. "processId": ${shell_script: get_pid}
解决方案
您可以使用"processId": "${command:pickRemoteProcess}",
打开一个进程选择器,以便您可以选择它。
推荐阅读
- python - Python tkinter 画布动画
- javascript - 如何在具有特定不同值对的对象数组中找到值的总和?
- wso2 - WSO2 API Manager 添加hal+json
- django - 如何保存在docker中创建的数据库?
- apache-storm - Apache Storm 集群未将拓扑的组件分配给所有可用的工作人员
- javascript - Javascript、php 和联系表的问题
- c# - 无法解决 Azure Active Directory 代码中的异常
- c# - 使用 System.Text.Json.JsonSerializer 处理无效的 UTF-16 字符
- python - 将帖子中提到的用户名作为个人资料链接返回到帖子中的那些用户
- http-live-streaming - 直播音频 HLS 流无法播放