Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Step into dll not possible (pdb available)

I have a solution with many projects and some of them are located outside of the solution path (I copy the compiled dll's and pdb's as Post-build event with xcopy)!

If I want to step into the dll's they are located outside of my solution:

"The breakpoint will not currently be hit. No symbols have been loaded for this document"

  • all files (dll's + pdb's + exe) are in the same directory
  • source files are at different places
  • step into to the internal dll's is possible

Which steps are needed to be able to debug also the external dll's?

like image 859
leon22 Avatar asked Apr 24 '13 08:04

leon22


People also ask

How do I debug a referenced DLL with pdb?

If it is a file (dll) reference, you need the debugging symbols (the "pdb" file) to be in the same folder as the dll. Check that your projects are generating debug symbols (project properties => Build => Advanced => Output / Debug Info = full); and if you have copied the dll, put the pdb with it.

What is pdb DLL?

Program database (PDB) is a file format (developed by Microsoft) for storing debugging information about a program (or, commonly, program modules such as a DLL or EXE). PDB files commonly have a . pdb extension. A PDB file is typically created from source files during compilation.

How do I unlock a PDB file?

If you see a message stating that Visual Studio cannot find or open the PDB file, try using Visual Studio's debugging tool. Go to Tools > Options > Debugging > Symbols and select Microsoft Symbol Servers.

How do I debug a referenced DLL?

Debug from the DLL project Set breakpoints in the DLL project. Right-click the DLL project and choose Set as Startup Project. Make sure the Solutions Configuration field is set to Debug. Press F5, click the green Start arrow, or select Debug > Start Debugging.


1 Answers

The simplest explanation is that the DLL simply isn't loaded yet. Double-check your assumptions with the Debug > Windows > Modules window, locate the DLL you are trying to debug in the list.

If you do find it back there then the debugger may have a problem reading the PDB file for it. Diagnose that by right-clicking the DLL and click Symbol Load Information. It shows you where the debugger looked for the PDB file.

In later VS versions also check the "User code" column in that same window. If it is set to "no" then use Tools > Options > Debugging > General, untick "Enable Just My Code".

Finally watch out for using a managed debugger to debug native code or the other way around. It isn't clear from the question since you forgot to document what kind of code you are trying to debug. You'll need to enable mixed mode debugging if that's the case.

like image 105
Hans Passant Avatar answered Sep 29 '22 06:09

Hans Passant