views:

304

answers:

2

I'm am trying to debug a DLL which is called from a VC++ application, but cannot step-inside the DLL function because the DLL source is located in another solution project.

I have tried to set a break point right before the DLL function call but when I try to step-in it just passes right down.

I am aware that it is possible to just debug the DLL on its own and feed it arguments, but since there are many variables, I do not find it practical for debugging purposes.

Is there a way to debug a DLL that is separate from the Invoking Application as if it where a single solution file?

+3  A: 

One thing you can do is start up your app outside of VS, open the solution with the DLL, and attach to the application.

Logan Capaldo
That did it!Didnt know it was so simple to attach to proccessesThank you!
Saifis
+1  A: 

Build a debug version of the DLL and link to it in the debug configuration of your project. That should get you what you need. It should find the source of the DLL and you should be able to step into it.

Rob K
thanks for the advice!
Saifis
How do you "link to it in the debug configuration of your project?" Thanks!
JamesBrownIsDead
If your DLL is named mydll.dll, then you have your dll project create mydll_d.dll in its debug configuration. Then your exe debug configuration links mydll_d.lib instead of mydll.lib (or loads mydll_d.dll instead of mydll.dll if it loads dynamically) and ensure that the mydll_d.pdb is with it.
Rob K