0

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.

Yogesh
  • 3,044
  • 8
  • 33
  • 60
  • Why don't you try to understand (and fix) why the executable does not works on build? – Steve B Mar 05 '14 at 08:35
  • Have you tried the option to copy the PDB files that you mentioned? That should work - if the PDB is located in the same folder as the EXE file, then VS will be able to load the symbols for the EXE. – Jason Evans Mar 05 '14 at 08:35

3 Answers3

0

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

Kristof
  • 3,267
  • 1
  • 20
  • 30
  • The right click solution is only for when you have loaded an old pdb. Check the link to see all the possiblities for loading a pdb. – Kristof Mar 05 '14 at 09:11
0

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

0
  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