Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 11-13-2007, 08:39 PM
cnuvas cnuvas is offline
Member
 
Join Date: Sep 2007
Posts: 78
Default Delphi Dll Debugging

I was trying the below step which I found in google search,
but still I am unable debug the dll in delphi 5.

When I set breakpoint the dll source, it was deactive and not able to reach the point. directly it is accessing the complied dll.

Points::
In the Project Manager make your DLL project active and press Ctrl+Shift+F11;
In the Project Options window which just appeared select Debugger node and on the right side of the window in the Host Application field specify the host application (press Browse button and select the application which use your library) and then close the dialog by pressing the Ok button;


Dll Code

procedure test;
begin

ShowMessage('hi');

end;

exports
test name 'test';

begin
end.

Exe Code
procedure test; external 'Project2.dll';

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
test;
end;


Please suggest me.

Thanks in advance
Reply With Quote
  #2  
Old 11-13-2007, 10:59 PM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 6,836
Default RE: Delphi Dll Debugging

And what doesn't work?

If you make the dll your active project and run. it should stop at any breakpoint inside the dll...

Objective reality is a delirium caused by lack of alcohol in blood.
There is no place like 127.0.0.1
Reply With Quote
  #3  
Old 11-13-2007, 11:04 PM
PetrB PetrB is offline
Senior Member
 
Join Date: Jul 2002
Posts: 530
Default RE: Delphi Dll Debugging

Hi,
I thing you are right. I use this way (depends on delphi version):
1) Compile main program
2) Open Dll in Delphi
3) Set host application to main program
4) Rebuild Dll
5) Set breakpoint
6) Run dll - main program will run
7) if you call dll from main you will reach a breakpoint.

Im mostly using D3 proff and have only problem with Dll debugging - I have to compile dll every time I need debug It. When I compile, run finish and run once more without compiling the debug point is not recognized.

If it help you please give me a point.
PB
Reply With Quote
  #4  
Old 11-14-2007, 12:41 AM
cnuvas cnuvas is offline
Member
 
Join Date: Sep 2007
Posts: 78
Default RE: Delphi Dll Debugging

Hi PB,

Thanks for your reply. But when I put the break point in the dll, after running the dll the following things are happenning

1) Application is run
2) Breakpoint is deactivated
3) application run the code(which is in dll whith out stopping the at break point as break point is deactivated.


Thanks
Srinivas
Reply With Quote
  #5  
Old 11-14-2007, 05:15 AM
PetrB PetrB is offline
Senior Member
 
Join Date: Jul 2002
Posts: 530
Default RE: Delphi Dll Debugging

I have a stupid question: Did you build up your dll with debug informations?
Did you try put breakpoint anywhere else, may be your selected code was optimized and taken out
Which version of Delphi are you use?

Sometimes when my debugging is not working I use a debug file - some txt file where are written important information from program during running.

If it help you please give me a point.
PB
Reply With Quote
  #6  
Old 11-14-2007, 07:04 AM
cnuvas cnuvas is offline
Member
 
Join Date: Sep 2007
Posts: 78
Default RE: Delphi Dll Debugging

Hi,

I am using the folllowing option

While build the dll I have done the following
Project->Options-> Under Linker Tab ->Include TD32 debug info selected.

Please let me know, if anything needs to be done.

Thanks in advance
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 12:53 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2014, vBulletin Solutions, Inc.