What shoule be written in program in launch.json?

I would like to debug in visual code. but I don't know what to write in program of launch.json properly. When I clicked run, nothing shows in the debug console. But I saw this in terminal.

cmd /C "c:\Users\zixia\.vscode\extensions\ms-vscode.cpptools-0.28.0-insiders\debugAdapters\bin\WindowsDebugLauncher.exe --stdin=Microsoft-MIEngine-In-vlizdhut.als --stdout=Microsoft-MIEngine-Out-umsq3mku.wao --stderr=Microsoft-MIEngine-Error-c1zrsgml.0bh --pid=Microsoft-MIEngine-Pid-pkw511t2.f4n --dbgExe=C:/Users/zixia/Desktop/mingw-w64/mingw64/bin/gdb.exe --interpreter=mi ".

The program I would like to debug is call "creditrating.cpp". Could anyone tell me what should be written in the program name in launch.json , please?

launch.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "(gdb) Launch",
			"type": "cppdbg",
			"request": "launch",
			"program": "${workspaceRoot}/creditrating.exe",
			"args": [],
			"stopAtEntry": false,
			"cwd": "${workspaceRoot}",
			"environment": [],
			"externalConsole": true,
			"MIMode": "gdb",
			"miDebuggerPath": "C:/Users/zixia/Desktop/mingw-w64/mingw64/bin/gdb.exe",
			"setupCommands": [
			    {
			        "description": "Enable pretty-printing for gdb",
			        "text": "-enable-pretty-printing",
			        "ignoreFailures": true
			    }
			]
		}
	]
}

Last edited on
Thank you so much for your reply! I have figured out how to construct both json. But I am now having trouble with something else...When I click run, I saw this in terminal:
cmd /C "c:\Users\zixia\.vscode\extensions\ms-vscode.cpptools-0.28.0-insiders\debugAdapters\bin\WindowsDebugLauncher.exe --stdin=Microsoft-MIEngine-In-vlizdhut.als --stdout=Microsoft-MIEngine-Out-umsq3mku.wao --stderr=Microsoft-MIEngine-Error-c1zrsgml.0bh --pid=Microsoft-MIEngine-Pid-pkw511t2.f4n --dbgExe=C:/Users/zixia/Desktop/mingw-w64/mingw64/bin/gdb.exe --interpreter=mi ".
Last edited on
Topic archived. No new replies allowed.