vscode除錯C程式

2022-08-20 17:00:17 字數 990 閱讀 6719

1、程式路徑不能有中文,因為mingw不支援

2、選擇乙個資料夾當作工作區,並且在該資料夾下建立./vscode資料夾,並在該資料夾下建立兩個json檔案

launch.json

/$.exe",

"args

": ,

"stopatentry

": false

,

"cwd

": "$"

,

"environment

": ,

"externalconsole

": true

,  //彈出黑框使用true,不彈出使用false

"mimode

": "

gdb"

,

"midebuggerpath

": "

d:/mingw/bin/gdb.exe

",  //選擇gbd.exe的絕對路徑

"prelaunchtask

": "

compile",

"setupcommands

": [

],},]}

tasks.json

",

"-o",

"$\\$.exe"],

"problemmatcher

": [

"$gcc"],

"group": }]

}

題外話:

如果想讓vscode執行向dev-c++一樣出現黑框的話,需要安裝c/c++ compile run外掛程式

除此之外,需要將設定-擴充套件-compile run configuration中找到如下選項進行勾選,使用f6執行

VSCode 帶引數除錯程式

本人向來比較喜歡 vs 類產品 比如 visual studio 2015 visual studio code 等 但是最近在處理 perl 指令碼的時候遇到了一些問題,比如我想要用 vscode 除錯perl 指令碼,並且讓該指令碼啟動的時候帶上引數,比如我想要除錯的是這樣的情況 test pe...

VSCode除錯設定

tasks.json vscodetutorial.unittest vscodetutorial.unittest.csproj istestcommand true,設定為單元測試專案 problemmatcher mscompile tasks.json檔案是專案任務的配置檔案,可在launc...

vs code 除錯設定

首先vs code 安裝外掛程式 debugger for chrome 使用下面內容替換自動生成的內容 使用外部伺服器時,請注釋掉 file,改用 url,並將 usebuildinserver 設定為 false 改成您的 chrome 安裝路徑 sourcemaps true webroot ...