• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Delphi2009RemoteDebugger远程调试

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

From  http://delphi.wikia.com/wiki/Remote_Debugger

Using the Remote Debugger with Delphi 2010 Edit

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]]

Edit

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.

Edit

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.

 

Edit

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:

 

 

  1. bccide.dll
  2. bordbk120.dll
  3. bordbk120N.dll
  4. comp32x.dll
  5. DCC120.dll
  6. 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.

Edit

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.

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).

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.

Edit

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.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
用Delphi进行数据库之间转换发布时间:2022-07-18
下一篇:
Delphi函数指针过程/函数类型发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap