 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Cult Guest
|
Posted: Wed Mar 03, 2004 2:16 pm Post subject: Debugging a BCB DLL loaded with "LoadLibary" |
|
|
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.
|
|
| Back to top |
|
 |
Hans Zandbergen Guest
|
Posted: Wed Mar 03, 2004 2:39 pm Post subject: Re: Debugging a BCB DLL loaded with "LoadLibary" |
|
|
In article <4045e8a7$1 (AT) newsgroups (DOT) borland.com>, [email]cult (AT) nospamuunospam (DOT) aa[/email]
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
|
|
| Back to top |
|
 |
Andrue Cope Guest
|
Posted: Wed Mar 03, 2004 3:05 pm Post subject: 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 debugger 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]
|
|
| Back to top |
|
 |
Andrue Cope Guest
|
Posted: Wed Mar 03, 2004 3:06 pm Post subject: 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 debugger will find it and give you the same
freedom to debug the DLL as it does the EXE.
--
Andrue Cope
[Bicester UK]
|
|
| Back to top |
|
 |
Cult Guest
|
Posted: Wed Mar 03, 2004 3:17 pm Post subject: Re: Debugging a BCB DLL loaded with "LoadLibary" |
|
|
thanks all - yep, its working like a charm ;)
|
|
| Back to top |
|
 |
Andrue Cope Guest
|
Posted: Wed Mar 03, 2004 4:30 pm Post subject: 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]
|
|
| Back to top |
|
 |
Tim Reago Guest
|
Posted: Wed Mar 03, 2004 7:45 pm Post subject: 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 debugger 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
|
|
| Back to top |
|
 |
Maurice Barnum Guest
|
Posted: Thu Mar 04, 2004 7:35 pm Post subject: 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 debugger 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.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|