Remote Debugger - Delphi Programming

Wikia

Wikia Navigation

Delphi Programming Navigation

Remote Debugger

Delphi 2010 is not able to load debug informations from remote files by default. You need to apply updates 4 & 5 to fix this.

Take a look on the release notes for this issue : [[1]]

The following instructions have been tested in Delphi 2007 and Delphi 2009: A similar process is known to work in Delphi 7.0. Remote debugging is considered unusable in Delphi 2005 and 2006.

Remote Debugger - Delphi Programming - yyimen - yyimen的博客

First Time Only: You need to insert your Delphi 2007 or 2009 product DVD on the target machine, or copy the "Remote Debugger Installer" files onto your network, and run them from there. Once you have the target machine configured (remote debugger installeed), go to C:\Program Files\Remote Debugger and double click on rmtdbt105.exe (delphi 2007), or rmtdbg120.exe (delphi 2009). Later on, I recommend that you run with the "-listen" command line parameter. You could create a batch file (remotedebugger.cmd) containing the following line:

rmtdbg120.exe -listen


To get the EXE file that Delphi builds onto your target machine, so you can load it using the remote debugger, we suggest you share the Target computer's C Drive, using Windows File Sharing, then use the Windows Explorer "Tools ->Map as Network drive" command, on your developer box. For example, you could make the C: drive from your test machine map as Q: on your developer box.

When you share the C: drive on your target machine, be sure to make it writeable, for only your particular user account+password combination. Do not use the "Everyone" permission, unless you want to invite your IT department to come over and introduce you to their new security policy documents.

If your EXE file needs any configuration files, or some setup on the remote machine before you first run the software, you should do that step next. To configure any runtime environment (consider registry settings, COM/DCOM OLE or ActiveX object registrations, other configuration files, etc). For example, I often make a folder C:\Program Files\DebugApp, and copy all configuration and data files over there.

When the remote debugger is running, you should see something like the picture shown at the top of this section, on your Target machine: (the <-listen> part is very important!). If you have done everything in this section, move to the next section now.


On the Target Machine (Rad Studio 2009 ESD version)

If you have a Rad Stuido 2009 ESD (download) edition, you don't have the remote debugger installer. However it is complete enough to do remote debugging:


Copy the follow files from your D2009 installation directory to the target machine:



bccide.dll bordbk120.dll bordbk120N.dll comp32x.dll DCC120.dll rmtdbg120.exe

Then register the relevant DLLs by issueing

regsvr32 /s bordbk120.dll regsvr32 /s bordbk120n.dll

on the cmdline , then use (like when using the installer)

rmtdbg120 -listen 8000

to start the remote debugging process

At least this worked on my Rad Studio 2009 ESD edition, repeated several times with various (XP,Vista,D2009) targets.

On your local Delphi developer machine

In your Delphi Project Options dialog box, you can change your EXE output folder. This saves you lots of time manually copying the EXE file after you build it. If the target's C drive is mapped as drive Q: for your developer machine, change the options of your project to output to Q:\Program Files\DebugApp folder, so that after compilation, the EXE ends up right at the place the remote debugger will expect it to be, on the target machine.

Make sure the Remote Debug Symbols option is checked in the Linker options in the Project Options.

Remote Debugger - Delphi Programming - yyimen - yyimen的博客


Rebuild the app so that the executable file is now built with the correct options and is now present on your your remote machine.

In Run menu, select select Load Process. Now click Remote (the second item in the Load Process listview on the left side of the load process dialog). Now fill out the two boxes called remote path, remote host, and optionally, working directory. All these are paths as seen on the remote machine. So for the remote machine's main hard drive, use C: as the path. The first item (remote path) is the name of the EXE file on the server. If you mapped your remote drive as Q above, and the path was Q:\FOO\BAR.EXE, you would type C:\FOO\BAR.EXE in this box. The second item (remote host) is an ip address or dns resolveable hostname, such as 192.168.0.xx or TARGETPC.ntdomain.company.com.

The remote path (and exe file name) must exist. The working directory also must exist.

Click Load button (leftmost button on bottom row of buttons in Load Process dialog). Remote Debugger - Delphi Programming - yyimen - yyimen的博客


You are now debugging remotely. You should see the debugger highlighting the first source code line in the application initialization code. Assuming everything worked, and there's no firewalls, network problems, etc etc.

I also like to use VNC Client and VNC Server to remote-desktop into my target debug machine, from the host machine I'm debugging on, when remotely debugging a GUI program.


Some of this came from a newsgroup posting by Warren Postma, later updated by User:Warren.postma, for Delphi 2009.

Read more

There is a feature of the Delphi IDE that is really hidden, because it requires you to add a registr

The Tools Menu of the Delphi IDE allows you to add additional items. In this article you will learn

Although Delphi is a fairly extensive language (and IDE) there are still quite a few features that w

Related Categories

External Sponsor Links

Click here!

Buy a sponsored link and description for your website on this page. Act quickly, the few sponsorship slots sell out fast!

Pages on Delphi Programming

Latest Photos

See more >

Recent Wiki Activity

See more > Healthy Recipes Wiki

Looking for healthy holiday meals? Discover and share your favorites!

See more... Fashion Wiki

Love fashion? Share what you know at the fashion wiki!

See more... Home Wiki

The ultimate wiki for home care, decor ideas, and more!

See more...Random Wiki

Around Wikia's network

Random Wiki

Wikia Inc Navigation




引文来源   Remote Debugger - Delphi Programming
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值