0

I'm developing several native C++ DLLs simultaneously using Visual Studio Ultimate 2013.

These DLLs are plugins for an application. I have configured Visual Studio's debugger in such a way that it launches that application (which in turns loads my plugins) and attaches to it.

Since these plugins are supposed to work together, I would like to debug them together, place breakpoints in them, etc.

Is there a way to achieve this?

The solution described in Running two projects at once in Visual Studio does not seem to apply here.

Community
  • 1
  • 1
François Beaune
  • 4,270
  • 7
  • 41
  • 65
  • You debug a process, not a DLL. As soon as you got the process running then *any* DLL that gets loaded by that process can be debugged. The breakpoint you set becomes armed as soon as the DLL that contains the line of code gets loaded. This is very discoverable, pretty hard to guess why you have a problem. Be sure to use the debugger's Debug > Windows > Modules window to ensure you see the DLL. And double-check there that the .pdb file for the DLL could be found. Right-click a DLL in the list and select "Symbol Load Information". – Hans Passant Dec 19 '15 at 16:06
  • Thanks Hans, it seems that you're right. For some reason, in my previous attemps the breakpoints in the DLL that wasn't the startup project were never active. It appears to work fine now. – François Beaune Dec 20 '15 at 01:11

1 Answers1

1

What I do when debuting DLLs is to have the debug build of the DLL open in Visual Studio, and make sure that the debug build is the one to be loaded by the calling application. I start the calling app, and pause it either by setting a breakpoint or showing an alert. Then go back to Visual Studio for the DLL, and from the Debug menu, select Attach To Process. Select the calling app's process. At that point, you should be able to set breakpoints in your DLLs in Visual Studio. Once that's done, you can proceed to run the calling app. I'd suggest you have each of the DLLs you are working on open in VS when you do this.

Logicrat
  • 4,438
  • 16
  • 22
  • 1
    Thanks. What I do is select one of the DLL as the startup project, and use the host app's executable as the Debug Command. The app is configured to automatically load my plugins at startup. As Hans said above, there is nothing particular to do to set breakpoints in multiple DLLs as long as they get loaded by the host app. – François Beaune Dec 20 '15 at 01:15