BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Debugging a BCB DLL loaded with "LoadLibary"

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (IDE)
View previous topic :: View next topic  
Author Message
Cult
Guest





PostPosted: Wed Mar 03, 2004 2:16 pm    Post subject: Debugging a BCB DLL loaded with "LoadLibary" Reply with 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.


Back to top
Hans Zandbergen
Guest





PostPosted: Wed Mar 03, 2004 2:39 pm    Post subject: Re: Debugging a BCB DLL loaded with "LoadLibary" Reply with quote



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





PostPosted: Wed Mar 03, 2004 3:05 pm    Post subject: Re: Debugging a BCB DLL loaded with "LoadLibary" Reply with quote



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





PostPosted: Wed Mar 03, 2004 3:06 pm    Post subject: Re: Debugging a BCB DLL loaded with "LoadLibary" Reply with quote

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





PostPosted: Wed Mar 03, 2004 3:17 pm    Post subject: Re: Debugging a BCB DLL loaded with "LoadLibary" Reply with quote

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



Back to top
Andrue Cope
Guest





PostPosted: Wed Mar 03, 2004 4:30 pm    Post subject: Re: Debugging a BCB DLL loaded with "LoadLibary" Reply with quote

On Wed, 3 Mar 2004 16:17:37 +0100, Cult wrote:

Quote:
thanks all - yep, its working like a charm Wink

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 Smile
--
Andrue Cope
[Bicester UK]

Back to top
Tim Reago
Guest





PostPosted: Wed Mar 03, 2004 7:45 pm    Post subject: Re: Debugging a BCB DLL loaded with "LoadLibary" Reply with quote

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





PostPosted: Thu Mar 04, 2004 7:35 pm    Post subject: Re: Debugging a BCB DLL loaded with "LoadLibary" Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (IDE) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.