Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WINDOWS debugger seems not to work #309

Closed
mazhan465 opened this issue Oct 26, 2016 · 8 comments
Closed

WINDOWS debugger seems not to work #309

mazhan465 opened this issue Oct 26, 2016 · 8 comments
Assignees
Labels

Comments

@mazhan465
Copy link

When I click debug only this message:
You may only use the C/C++ Extension for Visual Studio Code with Visual Studio
Code, Visual Studio or Xamarin Studio software to help you develop and test your

applications.

and then I couldn't do anything.The process seem not go into main funtion.Even My code have error,debugger still not any change.

@jacdavis
Copy link

  1. Can you check in the debugger output window and see if symbols are loaded for your application?
  2. Was your application compiled with the Visual C++ debugger or with GCC? If Visual C++, you are using the correct debugger. If gcc, then you need to use the gdb/lldb options.

Hope that helps

@mazhan465
Copy link
Author

mazhan465 commented Oct 27, 2016

"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch (Windows)",
"type": "cppvsdbg",
"request": "launch",
"program": "${file}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": false
},

That's parts of my launch.json.

]And I can't find anything output except:
“When I click debug only this message:
You may only use the C/C++ Extension for Visual Studio Code with Visual Studio
Code, Visual Studio or Xamarin Studio software to help you develop and test your
applications.”

@jacdavis
Copy link

What is ${file}? Can you please try putting in the path to the program instead? ${WorkspaceRoot} is the path to your open folder in vscode. Generally, we see that the most.

@mazhan465
Copy link
Author

${file} is full path of the current file.And if "program": "${workspaceRoot}/main.c",the result is the same as besides.

@jacdavis
Copy link

jacdavis commented Oct 28, 2016

This is because C and C++ are compiled as opposed to interpreted. You need to compile your code first, and then point the program field to the output of compilation (.exe file). For windows, that would mean using the standalone C++ tools (http://landinghub.visualstudio.com/visual-cpp-build-tools). You can also use a task.json file can also be created that can compile the code when you hit F5.

That said, there is a bug here that the extension is not erroring out when this happens.

@mazhan465
Copy link
Author

It semms rights.But how should I config my task.json.That seems mean I must install MSBuild?

@asthana86
Copy link

Mazhan, you can take a look at this blog which talks at length about how to build your C++ code inside Visual Studio Code, hope that helps.

https://blogs.msdn.microsoft.com/vcblog/2016/10/24/building-your-c-application-with-visual-studio-code/

@pieandcakes
Copy link
Contributor

@mazhan465 Is this the same issue as #316 ?

@pieandcakes pieandcakes self-assigned this Nov 1, 2016
asialasr pushed a commit to asialasr/vscode-cpptools that referenced this issue Mar 12, 2021
* adding new tests

* Improving test 'BreakPointWhenTrueCondition' based on some comments

* add tests for EE and funcbp

* modifies for functionbreakpoint

* some changes for ee debugges and function breakpoints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants