赞
踩
VS 安装CodeRunner插件
菜单→添加配置→lunch.json中设置如下:
program填入要调试的文件
{ "version": "0.2.0", "configurations": [ { "name": "gdb renderPng", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/renderPng", "args": [], "stopAtEntry": false, "cwd": "${fileDirname}", "environment": [], "externalConsole": false, "MIMode": "gdb", "setupCommands": [ { "description": "为 gdb 启用整齐打印", "text": "-enable-pretty-printing", "ignoreFailures": true }, { "description": "将反汇编风格设置为 Intel", "text": "-gdb-set disassembly-flavor intel", "ignoreFailures": true } ] }, ] }
{ "version": "0.2.0", "configurations": [ { "name": "gdb renderPng", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/renderPng", "args": [], "stopAtEntry": false, "cwd": "${fileDirname}", "environment": [], "externalConsole": false, "MIMode": "gdb", "miDebuggerPath":"/home/pozhu/Desktop/sudo_gdb", "setupCommands": [ { "description": "为 gdb 启用整齐打印", "text": "-enable-pretty-printing", "ignoreFailures": true }, { "description": "将反汇编风格设置为 Intel", "text": "-gdb-set disassembly-flavor intel", "ignoreFailures": true } ] }, ] }
新建脚本sudo_gdb
sudo /usr/bin/gdb $@
chmod 777 sudo_gdb
路径填在字段miDebuggerPath
继续 / 暂停 F5
跳过 F10
跳入 F11
跳出 Shift+F11
重启 Ctrl+Shift+F5
停止 Shift+F5
菜单→终端→添加任务→新建tasks.json
内容如下:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。