Click to See Complete Forum and Search --> : How to locate bugs in dlls?


Kuzy
May 11th, 2005, 09:02 AM
Hi,

I wrote an application which contains a dll. I compiled it in debug mode and run it from my main app.
Now debugging seems to be a bit complicated. I am able to set breakpoints inside my dll and the net environment stops running it at these points showing me the actual line. That is very helpful.
But if my dll is stopped by a bug, a exception window is shown and the cursor doesn't show me the line the exception occured. It just shows me a line in the main-thread of my Application.

Why?

How do I configure my developing environment to show me the line a exception occured inside a dll?

Thanks to all having ideas about this topic.

Kuzy

klintan
May 11th, 2005, 09:07 AM
One problem could be that the debugger not is configured to stop on exceptions: Go into the menu Debug, Exceptions, mark Common Language Runtime Exceptions, and in "When the exception is thrown" click the radio button "Break into the debugger".

Maybe you also need to have both projects in the same solution, I don't know if you have that, if not then it could be a problem.

MadHatter
May 11th, 2005, 09:35 AM
from the dll project, select debug:

http://www.sanity-free.org/Samples/debug.jpg

then select Processes & select the running exe that the dll is loaded in.

http://www.sanity-free.org/Samples/process.jpg
(select Attach, click ok then click close)

set a breakpoint in your dll and debug it from there.

Kuzy
May 11th, 2005, 09:43 AM
Thanks to all.
The solution was to reconfigure exceptions. Now it works.
:)