my os version is sierra 10.12.1 and vs code version is 1.8.1. I installed c++ plugin in vs code. And then I created a c++ project. There was my c++ source file.
my_simple.cc
int main(int argc, char const *argv[])
{
printf("%s\n", "******begin******");
int a = 1;
int b = a;
printf("%s\n", "******end******");
return 0;
}
launch.json
{
"version": "0.2.0",
"configurations": [
{
"preLaunchTask": "pre_compile",
"showDisplayString": true,
"name": "my_debug",
"type": "cppdbg",
"request": "launch",
"program": "${file}.o",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": false,
"osx": {
"MIMode": "lldb"
}
}
]
}
tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "g++",
"isShellCommand": true,
"args": [
],
"showOutput": "always",
"echoCommand": true,
"suppressTaskName": true,
"tasks": [
{
"taskName": "pre_compile",
"args": [
"${file}",
"-o${file}.o"
],
"isBuildCommand": true
}
]
}
When I add some breakpoints to my_simple.cc and then press f5 to compile and run it. The breakpoints did not work as expected. Please help me find the mistake in my code. Thanks
int main(int argc, char const *argv[]) { fputs("******begin******\n******end******\n",stdout); return 0 }- but that level of aggression is unusual.