問題
launch.jsonの設定が出来ずWSL上のgdbによるデバッグが実行できません。
環境
Windows 10
g++ on WSL(Ubuntu 18.04)
VSCode
やったこと
以下の設定をしました。
setting.json
{ //terminal shell setting "terminal.integrated.shell.windows": "C:\Windows\System32\wsl.exe", //Anothers "window.zoomLevel": 0, "explorer.confirmDelete": false, "explorer.confirmDragAndDrop": false, //git "git.path": "D:\Working\wslgit.exe", }
tasks.json
{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "g++", "type": "shell", "command": "g++", "args": [ "-std=c++14", "-g", "-O2", "-o", "`wslpath", "'${workspaceRoot}\debug\${fileBasenameNoExtension}.out'`", "`wslpath", "'${file}'`", ], "group": { "kind": "build", "isDefault": true } } ] }
ここで${workspaceRoot}/src/b.cc
から${workspaceRoot}/debug/b.out
の生成には成功しましたが、launch.jsonの設定が分からず困っています。(一部pathを書き替えています)
{ // IntelliSense を使用して利用可能な属性を学べます。 // 既存の属性の説明をホバーして表示します。 // 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "(gdb) Bash on Windows Launch", "type": "cppdbg", "request": "launch", "program": "/path/to/debug/${fileBasenameNoExtention}.out", "args": [], "stopAtEntry": false, "cwd": "/path/to/debug", "environment": [], "externalConsole": true, "pipeTransport": { "debuggerPath": "/usr/bin/gdb", "pipeProgram": "${env:windir}\system32\bash.exe", "pipeArgs": ["-c"], "pipeCwd": "" }, "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] }, ] }
これに対して出力が
Stopping due to fatal error: NullReferenceException: オブジェクト参照がオブジェクト インスタンスに設定されていません。
となりデバッグが行えません。
設定ミスであることは分かっていますが検索しても正しく実行出来るものが見つからず困っています。どなたかご助力戴けませんか。
あなたの回答
tips
プレビュー