views:

91

answers:

2

I am able to connect to the remote machine and debug and see the source code, but when I set a break point Visual Studio don't break on it.

So is there something that needs to be done?
Or is it simply not possible to use breakpoints while remote debugging?

+4  A: 

Yes it is. You need to make sure that the PDB (debug information with line info) is present and loaded in the debugger when connecting to the remote site, because without it the debugger cannot associate source lines to bytecode offsets, which is required to set a breakpoint.

Lucero
You're right that it should work, but the PDBs don't need to be on the remote machine. The Remote Debug Monitor doesn't need access to the PDBs. The PDBs need to be on the machine where Visual Studio is running - it's Visual Studio that uses the PDBs to map from source lines to addresses, and it passes those addresses to the Remote Debug Monitor.
RichieHindle
Does the remote build have to be a DEBUG build or can it be a RELEASE build?
j0rd4n
Right, that's actually what I wanted to say, but typed it wrong. Fixed. I don't see why I was downvoted though, because the basic info was still correct.
Lucero
@j0rd4n: As long as PDB files are created, both are working, but release builds are optimized, so that some source may be compiled to code which cannot be mapped exactly to the source anymore.
Lucero
A: 

The quick answer is yes, however there are a number of different things that might be stopping the break point from being triggered. Long ago I posted this checklist as an answer to another question, it might help you now:

http://stackoverflow.com/questions/1199088/why-does-my-c-debugger-skips-the-break-points/1199272#1199272

In particular check to see if the graphic for the breakpoint is solid (indicating that the breakpoint should be hit if you reach it) or if the breakpoint is just an empty circle with a little exclamation mark next to it - if you get the exclamation mark then check the tool tip you get when you hover over it, it might tell you what the problem is.

Finally, its perfectly possible to debug a RELEASE build, however you need to make sure that you produce symbols when you build - these can either be in an external file (a .pdb), or sometimes they can be embedded into the assembly itself (although I've never done this myself)

Kragen