Debugging explicit DLL: No breakpoints allowed

Hi,

I have a DLL compiled with debug information and used explicitly via LoadLibrary and GetProcAddress. I have an EXE (also compiled in debug) that loads the DLL, and I know its loading the DLL from the DLL project's DEBUG directory. The EXE/DLL work fine, I just want to debug a particular feature within the DLL, so I know the whole linking thing is ok.

I load the DLL project and launch the debugger (which starts the EXE app that loads it). All my breakpoints become "?"'s and complain that the code was never loaded. I know the code was loaded, I can see this from the EXE side.

I have read the MSDN article on debugging dlls, but just can't seem to make VC++ happy.

Any ideas?

Thanks,
Doug
[766 byte] By [doug_dyer] at [2007-11-18 19:16:46]
# 1 Re: Debugging explicit DLL: No breakpoints allowed
Under project settings->debug-->category>addtional modules, add your dll so it's symbols are preloaded when you fire off the debugger.
Mick at 2007-11-11 1:18:01 >
# 2 Re: Debugging explicit DLL: No breakpoints allowed
Originally posted by Mick
Under project settings->debug-->category>addtional modules, add your dll so it's symbols are preloaded when you fire off the debugger.

That sounds useful! Is this a setting I place in the DLL project or the executable that loads it?

Where is this setting BTW? I can't seem to find "additional modules" anywhere. I have VC v7.0. I checked the project's properties dialog. I looked at the "debugger" properties in this dialog and the "linker/debug" properties.
doug_dyer at 2007-11-11 1:19:02 >
# 3 Re: Debugging explicit DLL: No breakpoints allowed
Ah never mind I think I got it... thanks
doug_dyer at 2007-11-11 1:19:57 >
# 4 Re: Debugging explicit DLL: No breakpoints allowed
Make sure you do not have another copy of your DLL that gets picked up by LoadLibrary().
VladimirF at 2007-11-11 1:21:03 >
# 5 Re: Debugging explicit DLL: No breakpoints allowed
Originally posted by doug_dyer
That sounds useful! Is this a setting I place in the DLL project or the executable that loads it?

Where is this setting BTW? I can't seem to find "additional modules" anywhere. I have VC v7.0. I checked the project's properties dialog. I looked at the "debugger" properties in this dialog and the "linker/debug" properties.

I'm not sure where it is on 7.0 (still use 6.0) check the docs, should be in the debugging section.

The additonal modules would be any module whos debugging symbols you want to pre-load.

If you have three seperate dll's that your using via LoadLibrary(...)/GetProcAddress(...) then add those three. What is probably happening, is since your explicitly loading it, you've set breakpoints before the load happens, thus before the debugger goes and looks for the symbols (I assume it finds the symbols in the debug output window when you do the LoadLibrary(...)) therefore before it is loaded all of your breakpoints are undefined.

You could also go with the ole DebugBreak(...) in the .DLL...
Mick at 2007-11-11 1:22:02 >