Mahol Dot Org

Icon

Weblog For All Your Need

How To Run .exe In Debug Mode Microsoft Visual Studio 2008

How to run .exe in debug mode microsoft visual studio 2008?
Here are few solutions I got for Running .exe in debug mode using the Windows debugger.

Using Devenv

Devenv allows you to set various options for the integrated development environment (IDE);

/DebugExe

Loads a Visual C++ executable under the control of the debugger. This switch is not available for Visual Basic or Visual C# executable.

Example : if your win32 binary executable name is test.exe then, to run this win32 binary in debug mode use this command on windows command prompt.

C:\tmp>devenv /DebugExe test.exe

Your default debugger will start and loads this binary for debug mode. Then just hit F10 Key to go to main function. For Now on your debugging starts, ie to step into function use F11 key, you can put breakpoints and all debugging stuff.
I assume that you have compiled the binary test.exe with debug flag enabled, else debugger will not find the debug symbols and will not load the code.

Using Image File Execution Options

To setup an application to launch the debugger automatically.
How to: Launch the Debugger Automatically
the Image File Execution Options folder, locate the name of the application you want to debug, such as myapp.exe. If you cannot find the application you want to debug:

  1. right-click the Image File Execution Options folder, and on the shortcut menu, click New Key.
  2. Right-click the new key, and on the shortcut menu, click Rename.
  3. Edit the key name to the name of your application; myapp.exe, in this example.

read more
How to open a file, and go to a line number
devenv /edit E:\code.cpp /command “edit.goto 45″

In this example, devenv will open the code.cpp file, and go to line 45.

Number of View :1399

Related posts:

  1. How To _access Function For Long File Names As Path In Winddows Programming Use UNC
  2. How To Resolve Error __curr_eh_stack_entry and __eh_curr_region With pgcpp C++ Compiler
  3. ICET 2010 answer Key www.icet2010.net/
  4. EAMCET Key 2010 at www.apeamcet.org
Receive Updates By Email

Enter your email address:

Delivered by FeedBurner

Category: Tips & Tricks

Tagged: , ,

One Response

  1. [...] Synonyms: “r”. To run the exe in debug mode from command line, use devenv with debugexe option.. read more for How To Run .exe In Debug Mode Microsoft Visual Studio. [...]

Leave a Reply

Lost !! Use Advanced Search

Categories

Content Protected Using Blog Protector By: PcDrome.

Mahol Dot Org is Digg proof thanks to caching by WP Super Cache