views:

192

answers:

2

Since I do not have access to the complete source code of a library I'm using, but I do have the pdb files, is it possible to set a breakpoint in the "debugging source code"?

If so, how would I do that?

+2  A: 

You need the source code in order to set a breakpoint.

You may be able to reconstruct the source code by disassembly, but chances are that it won't be line for line identical to the original and as such useless for line by line debugging.

Oded
+2  A: 

Yes, this is possible, you don't need the source code. Debug + New Breakpoint + Break at Function. Set the location to the name of the function. For example: "Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly". Turn the "Use Intellisense" checkbox off, you won't have any. Language is a guess if you don't know what it was written in, choose "Unknown" if you're not sure.

You'll want to keep an eye on the Debug + Windows + Breakpoints window to verify that the debugger could resolve the breakpoint. It won't be able to until the assembly gets loaded and the method gets JIT compiled.

This is of course not the greatest debugging experience. Once the breakpoint hits, you don't have anything to look at but the machine code generated by the JIT compiler. And the Call Stack window, your ultimate resource to see method names btw.

Hans Passant