質問編集履歴

1

不具合について具体的に書き直しました。また、ソースコードを変更しました。

2022/11/28 09:31

投稿

Cas9bah
Cas9bah

スコア2

test CHANGED
File without changes
test CHANGED
@@ -10,92 +10,73 @@
10
10
  ### 発生している問題・エラーメッセージ
11
11
 
12
12
  ```
13
+ デバッグを行おうとすると「PrelaunchTask'echo'が終了コード1で終了しました。」とエラーが出ます。そのあと「このままデバッグ」を押しても
13
- (https://ddjkaamml8q8x.cloudfront.net/questions/2022-11-28/7f53480c-73b3-42e9-97cb-788e30d42294.png)
14
+ "Unable to start debugging. Program path 'C:\\Users\{Username}\Downloads\かだい4.cpp' is missing or invalid.
15
+
16
+ GDB failed with message: C:\\Users\{Username}\Downloads\かだい4.cpp: No such file or directory.
17
+
18
+ This may occur if the process's executable was changed after the process was started, such as when installing an update. Try re-launching the application or restarting the machine."
19
+ とエラーメッセージが表示されます。
14
20
  ```
15
21
 
16
22
  ### 該当のソースコード
17
23
  launch.json
18
24
  ```C++
19
25
  {
20
- // Use IntelliSense to learn about possible attributes.
21
- // Hover to view descriptions of existing attributes.
26
+ {
22
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
23
- "version": "0.2.0",
27
+ "version": "0.2.0",
24
- "configurations": [
28
+ "configurations": [
25
- {
29
+ {
26
- "name": "g++ - Build and debug active file",
30
+ "name": "g++.exe - Build and debug active file",
27
- "type": "cppdbg",
31
+ "type": "cppdbg",
28
- "request": "launch",
32
+ "request": "launch",
29
- "program": "${fileDirname}/${fileBasename}",
33
+ "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
30
- "args": [],
34
+ "args": [],
31
- "stopAtEntry": true,
35
+ "stopAtEntry": false,
32
- "cwd": "${workspaceFolder}",
36
+ "cwd": "${fileDirname}",
33
- "environment": [],
37
+ "environment": [],
34
- "externalConsole": false,
38
+ "externalConsole": false,
35
- "MIMode": "lldb",
39
+ "MIMode": "gdb",
40
+ "miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
36
- "setupCommands": [
41
+ "setupCommands": [
37
- {
42
+ {
38
- "description": "Enable pretty-printing for gdb",
43
+ "description": "Enable pretty-printing for gdb",
39
- "text": "-enable-pretty-printing",
44
+ "text": "-enable-pretty-printing",
40
- "ignoreFailures": true
45
+ "ignoreFailures": true
41
- },
42
- {
43
- "description": "Set Disassembly Flavor to Intel",
44
- "text": "-gdb-set disassembly-flavor intel",
45
- "ignoreFailures": true
46
- }
46
+ }
47
- ],
47
+ ],
48
- "preLaunchTask": "echo",
48
+ "preLaunchTask": "echo"
49
- "miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe"
50
49
  }
51
- ]
50
+ ]
52
51
  }
53
52
  ```
54
53
  tasks.json
55
54
  ```C++
56
55
  {
57
- "version": "2.0.0",
56
+ "version": "2.0.0",
58
- "tasks": [
57
+ "tasks": [
59
- {
58
+ {
60
- "label": "echo",
59
+ "label": "echo",
61
- "type": "shell",
60
+ "type": "shell",
62
- "command": "gcc",
61
+ "command": "gcc",
63
- "args": [
62
+ "args": [
64
- "-g",
63
+ "-g",
65
- "${fileBasename}"
64
+ "${fileDirname}\\${fileBasename}"
66
- ],
65
+ ],
67
- "group": {
66
+ "group": {
68
- "kind": "build",
67
+ "kind": "build",
69
- "isDefault": true
68
+ "isDefault": true
70
- }
69
+ }
71
- },
72
- {
73
- "type": "cppbuild",
74
- "label": "C/C++: cpp.exe アクティブなファイルのビルド",
75
- "command": "C:\\MinGW\\bin\\cpp.exe",
76
- "args": [
77
- "-fdiagnostics-color=always",
78
- "-g",
79
- "${fileDirname}\\${fileBasenameNoExtension}.exe"
80
- ],
81
- "options": {
82
- "cwd": "${fileDirname}"
83
- },
84
- "problemMatcher": [
85
- "$gcc"
86
- ],
87
- "group": "build",
88
- "detail": "コンパイラ: C:\\MinGW\\bin\\cpp.exe"
89
- }
70
+ }
90
- ]
71
+ ]
91
72
  }
92
73
  ```
93
74
 
94
75
  ### 試したこと
95
76
 
96
- ここに問題に対て試したこと記載してください。
77
+ い変数指定していないか等を検討しました
97
78
 
98
79
  ### 補足情報(FW/ツールのバージョンなど)
99
80
 
100
- 環境:Windows10
81
+ 環境:Windows10
101
82