Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging an executable in visual studio

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.

like image 758
Geet Avatar asked Feb 26 '13 19:02

Geet


People also ask

How do I run an executable code in Visual Studio?

In Visual Studio, select File > Open > Project. In the Open Project dialog box, select All Project Files, if not already selected, in the dropdown next to File name. Navigate to the .exe file, select it, and select Open. The file appears in a new, temporary Visual Studio solution.

Can an EXE file be decompiled?

Many developers are still not aware that Portable Executable (PE) files can be decompiled to readable source code. Before learning how to prevent or make it hard for the decompilers to reverse engineer the source code, we need to understand few basics concepts.


1 Answers

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.

like image 114
matra Avatar answered Oct 11 '22 13:10

matra