Yogesh
Yogesh

Reputation: 3076

How to debug a build .exe with attach to process in visual studio 2010

All, I have a build installed on my machine and some functionality is working perfectly in code( in both modes release and debug) but that functionality is not working only in build. So, I want to debug that .exe using attach to process. So, I start up the buid .exe from desktop shortcut and attach the visual studio to that .exe but visual studio says that no .pdb file is there, so it can't be debugged. So, one option is this

  1. Build the project in debug mode and should copy the dll and pdb in the folder where build is installed in program files is that right??, will it work.

Or I have to do something else for debugging that code.

Upvotes: 0

Views: 5987

Answers (3)

user3264965
user3264965

Reputation: 1

  1. The easiest is to add the .pdb in the same directory as the .exe as already mentioned

  2. Additionally, include or exclude pdbs:
    Tools -> Options -> Debugging -> Symbols
    Can either select all modules (with exclusions) or select specific modules to load

  3. Disable just my code:
    Tools -> Options -> Debugging -> General
    Untick 'Just My Code'

  4. Debug Microsoft libraries
    You might want to add Microsoft's symbol server
    Tools -> Options -> Debugging -> Symbols

Good to read http://msdn.microsoft.com/en-us/library/ms241613.aspx

Upvotes: 0

Igor Lutsyk
Igor Lutsyk

Reputation: 79

You should copy .PDB(symbol) files to the location where .EXE file exist, then VisualStudio would attach to process and let you start debuging process there.

Also, you can setup Microsoft symbol server. Check this article

Upvotes: 0

Kristof
Kristof

Reputation: 3315

You can specify which pdb's visual studio needs to load when it starts the debugger.
Make sure they are the right version or you will need to specify on your breakpoints(via right clicking => location => allow source code to be different).

More info here

Upvotes: 0

Related Questions