Board index » cppbuilder » Debugging a BCB DLL loaded with "LoadLibary"

Debugging a BCB DLL loaded with "LoadLibary"


2004-03-03 10:16:08 PM
cppbuilder8
Hi,
I have an application that uses LoadLibary to load a DLL during runtime.
My project in BCB enviorment consist of my application and this DLL - is
there any way i can debug also in the DLL in the BCB ide, when im loading it
the way i am ?
thanks.
 
 

Re:Debugging a BCB DLL loaded with "LoadLibary"

In article <4045e8a7$ XXXX@XXXXX.COM >, XXXX@XXXXX.COM
says...
Quote
Hi,

I have an application that uses LoadLibary to load a DLL during runtime.

My project in BCB enviorment consist of my application and this DLL - is
there any way i can debug also in the DLL in the BCB ide, when im loading it
the way i am ?

thanks.



Yes, i have an excutable and some DLL's which I am able to debug. (made
in CBuilder 6).
With the Dll select Run->Parameters and fill in the application.
If placed both project in a project-group, debugging of both the dll and
the executable is possible.
Hans Zandbergen
 

Re:Debugging a BCB DLL loaded with "LoadLibary"

On Wed, 3 Mar 2004 15:16:08 +0100, Cult wrote:
Quote
My project in BCB enviorment consist of my application and this DLL - is
there any way i can debug also in the DLL in the BCB ide, when im loading it
the way i am ?
Sure. As long as the debug information (TDS) is in the same directory as
the DLL the de{*word*81} will find it and you can step into the DLL code
without any action on your part. In fact you're more likely to have a
problem not realising that you are looking at DLL code since the transition
is seamless.
The only issue is that breakpoints within the DLL will be shown as disabled
until the DLL has actually been loaded. Breakpoints can still be set though
exactly as you would in your EXE.
--
Andrue Cope
[Bicester UK]
 

{smallsort}

Re:Debugging a BCB DLL loaded with "LoadLibary"

On Wed, 3 Mar 2004 15:39:42 +0100, Hans Zandbergen wrote:
Quote
If placed both project in a project-group, debugging of both the dll and
the executable is possible.
It's possible without doing that. As long as the TDS is in the same
directory as the DLL the de{*word*81} will find it and give you the same
freedom to debug the DLL as it does the EXE.
--
Andrue Cope
[Bicester UK]
 

Re:Debugging a BCB DLL loaded with "LoadLibary"

thanks all - yep, its working like a charm ;)
 

Re:Debugging a BCB DLL loaded with "LoadLibary"

On Wed, 3 Mar 2004 16:17:37 +0100, Cult wrote:
Quote
thanks all - yep, its working like a charm ;)
Just remember which project is which when you edit the source code. Many's
the time I have fixed a bug in the DLL then rebuilt the EXE and wondered
why the fix didn't work.
I have a feeling I'm not alone here :)
--
Andrue Cope
[Bicester UK]
 

Re:Debugging a BCB DLL loaded with "LoadLibary"

Quote
It's possible without doing that. As long as the tds is in the same
directory as the dll the de{*word*81} will find it and give you the same
freedom to debug the dll as it does the exe.
On occassion I've noticed that even if the tds is in the same directory and
even after full rebuilds, BCB5 won't stop in the dll.
In those cases, adding the dll to View | Debug Windows | Modules | Right
Click | Add Module..., was the only solution. And some other times
debugging works like the dll is part of the exe. Cause for variation,
unknown to me.
Tim
www.spitbit.com/mousehead/index/htm
 

Re:Debugging a BCB DLL loaded with "LoadLibary"

Quote
On occassion I've noticed that even if the tds is in the same directory and
even after full rebuilds, BCB5 won't stop in the dll.

In those cases, adding the dll to View | Debug Windows | Modules | Right
Click | Add Module..., was the only solution. And some other times
debugging works like the dll is part of the exe. Cause for variation,
unknown to me.
are you running XP? if the dll was relocated at load time, then the
BCB5 de{*word*81} won't know the path of the dll (the debugging
notifcation doesn't include the information in this case). without
the path, it becomes rather impossible to find the tds file, so you
get no symbols.
 

Re:Debugging a BCB DLL loaded with "LoadLibary"

2k