Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Visual Studio, can I put breakpoints in code for which I only have debugging symbols?

Tags:

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?

like image 707
sebastiaan Avatar asked Dec 24 '09 12:12

sebastiaan


People also ask

How do I add a conditional breakpoint in Visual Studio?

Right-click the breakpoint symbol and select Conditions (or press Alt + F9, C). Or hover over the breakpoint symbol, select the Settings icon, and then select Conditions in the Breakpoint Settings window.

How do you set a conditional breakpoint?

To set a conditional breakpoint, activate the context menu in the source pane, on the line where you want the breakpoint, and select “Add Conditional Breakpoint”. You'll then see a textbox where you can enter the expression. Press Return to finish.


1 Answers

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.

like image 159
Hans Passant Avatar answered Sep 20 '22 00:09

Hans Passant