vscode远程调试 bash 文件的 launch.json写法示例

{

"version": "0.2.0",

"configurations": [

{

"name": "${workspace}/train_net.py",

"type": "python",

"request": "launch",

"args": [

"--config-file",

"configs/coco-stuff-164k-156/mask2former_maft.yaml",

"--num-gpus",

"1"

],

"program": "${file}",

"console": "integratedTerminal",

"env": {

"DETECTRON2_DATASETS": "/home/zhongqiang.zhang/data/"

}

}

]

}


 

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个使用VS Code和Docker进行C++调试示例launch.json文件: ```json { "version": "0.2.0", "configurations": [ { "name": "Docker C++ Debug", "type": "cppdbg", "request": "launch", "program": "/path/to/your/executable", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "MIMode": "gdb", "miDebuggerPath": "/usr/bin/gdb", "miDebuggerArgs": "-q", "setupCommands": [ { "description": "Enable gdb pretty-printing for gdb 7.5 and later", "text": "-enable-pretty-printing", "ignoreFailures": true } ], "dockerLaunch": { "image": "your-docker-image-name", "dockerBuild": "always", "network": "host", "mounts": [ { "source": "${workspaceFolder}", "target": "/mnt", "type": "bind", "consistency": "cached" } ], "ports": [ { "containerPort": 8080, "hostPort": 8080 } ], "command": "bash" }, "sourceFileMap": { "/mnt": "${workspaceFolder}" } } ] } ``` 你需要将其中的`/path/to/your/executable`替换为你的可执行文件所在的路径,将`your-docker-image-name`替换为你的Docker镜像名称。如果你的可执行文件与源代码在同一目录下,可以将`/path/to/your/executable`替换为`./your-executable`。 此外,这个配置文件还使用`dockerLaunch`选项指定了一些Docker容器的配置,包括镜像名称、网络设置、挂载卷、端口映射等等。你需要根据你的实际情况进行修改。 最后,你需要在VS Code中打开你的工作区,并在调试面板中选择`Docker C++ Debug`配置,然后按下F5键启动调试器。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值