how to debug Tough3 in vscode
Hi all,
When configuring, I changed the -- build type to debug, which can generate an executable file called tough3-eco2n in the tough3-install folder. Then, I opened the source code in the src folder in vscode and set breakpoints. However, when running the codes, there was no interruption at the breakpoint. What is the reason for this? Thank you very much.
Yong
The following is the lauch.json in vscode:
{
"version":"2.0.0",
"configurations":[
{
"name":"toughGDB",
"type": "cppdbg",
"request":"launch",
"program": "${workspaceRoot}/src/test/tough3-eco2n",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}/src/test",
"externalConsole": false,
"MIMode": "gdb",
"targetArchitecture": "x86",
},
{
"name": "Intel Debug Attach",
"type": "cppvsdbg",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
4 replies
-
If you want to debug the tough3, you need
(1) change the compilation type to DEBUG type.
(2) edit the tough3.fi to uncomment the module you are going to compile (tough3.fi provided in V1.1)
(3) compile it.
(4) rename the input file to "INFILE" and copy it to the VS default working folder (the default working folder could be the folder where the project file *.vfproj located, not sure. If you put the input file in wrong folder, you will always get the file fort.36 in default working folder.)
(5) set a breakingpoint (F9), and then start debugging (F5)