Debugging an executable in visual studio

Geet picture Geet · Feb 26, 2013 · Viewed 44.5k times · Source

Want to debug an executable under debugger. How to do it in visual studio.

Windbg has an option of open executable. But I find this is missing in VS 2010.

The question is not exactly same as Debug exe in visual studio 2010 as I am not really interested in image file execution to debug a start up.

Rather want to just debug the exe under debugger, once it is broken, want to set some break points and understand the flow of execution.

Albeit image file execution is a workaround for this.

I am not sure if this question is naive; But this is a very straight line use case scenario, I find missing in MS VS 2010.

Answer

matra picture matra · Feb 26, 2013

You did not specify it in the question, but I assume you do not have the source code. Just use File/Open Project/Solution, select EXE file and Open it. Then select Debug/Start debugging. The other option is to run the EXE first and then Select Debug/Attach to process.