11

I recently posted this question about my inability to get Delphi 2010 working with remote debugging. I have not had any success and decided to post up a simple step-by-step test technique that might highlight what I'm doing wrong. THIS IS REALLY IMPORTANT to me - I've used Delphi since V1.0 and earn my living from it. Being stuck like this is a pain and its keeping me on Delphi 7.

Anyway, here goes.

  1. Ensure that Delphi 2010 has updates 4&5.

  2. Fire up Delphi 2010, then File | New | VCL Forms App. Put a button on the form, put 'ShowMessage( 'hello' ) in the button OnClick event. Save the project and its unit in a local folder "C:\scratch". Build the project, run it, click the button, 'hello' appears, all fine.

  3. On a networked PC (194.168.1.64), create a new folder "c:\DebugTest" and share it with R/W access.

  4. On 194.168.1.64 install the Remote Debugger from the latest download on the Embarcadero Website (RemoteDebugger_upd2.exe). CLick rmtdbg140.exe to run. Accept the 'un-block' message from the firewall.

  5. Edit the DEBUG build configuration compiler settings with Output directory=\192.168.1.64\DebugTest and unit output directory = c:\scratch - see Compiler settings

  6. Edit the Linking settings to set Debug Information=True, Include remote debug symbols=True. See Linking settings

  7. Leave compiling settings at defaults. See Compiling settings

  8. Do a full build. The relevant project exe 'project2.exe' and 'project2.rsm' appear in the remote folder \192.168.1.64\DebugTest. Blue dots are visible in Unit2 in the IDE.

  9. Set a breakpoint on the 'ShowMessage' line (the button OnClick event).

  10. Use 'Run' | 'Load Process' with Remote path=c:\DebugTest\Project2.exe, Remote Host=192.168.1.64 and Working directory=c:\DebugTest see Load Process remote tab

  11. Click 'Load'. The visible breakpoint is immediately disabled, the project starts running and opens the CPU window and stops. Pressing f9 cause the exe to run fully on the remote machine, the button works, you just cannot debug it.

I've tried various 'obvious' things like firewall off but all to no avail. Could some kind person suggest further ideas?

Many thanks.

Community
  • 1
  • 1
Brian Frost
  • 13,334
  • 11
  • 80
  • 154
  • 3
    I am stuck with the Delphi 2007 Remote Debugger as well. http://stackoverflow.com/questions/4893722/delphi-remote-debugger-freezing-up – Robert Love Feb 16 '11 at 15:36
  • I'm pretty sure I've done this with D2010. My way of working is different from #9 on: I start the debugee by double clicking it in Windows Explorer (on the remote computer). Then I walk to my development computer and attach to the process. Then I set the breakpoint and press F9 so the debugee continues to run. – Giel Feb 16 '11 at 15:53
  • IIRC you should use `\\192.168.1.64\DebugTest` in the 'Remote path' and 'Working directory' fields of the 'Remote' dialog with this setup. – Sertac Akyuz Feb 16 '11 at 16:37
  • Just checked with D2007, it works both ways, yours being the correct one.. Not surprising as the remote machine can also resolve the UNC path of course.. – Sertac Akyuz Feb 16 '11 at 17:11
  • 1
    We have had the *exact same* experience with D2010 remote debugging. With D2009 remote debugging worked fine, but we have not yet found a way to get D2010 to play nicely. – Marjan Venema Feb 16 '11 at 17:16
  • Delphi 2010 remote debugging looks like a lost cause to me. And not for lack of trying! – Cosmin Prund Feb 16 '11 at 17:57
  • 2
    @All of you: Do we think that XE is any more willing and able? My cheque book is out and ready if it is. – Brian Frost Feb 16 '11 at 22:29

4 Answers4

6

Well, for me the problem has now been solved, although as a 'work around' and after significant interaction with Embarcadero and an upgrade to XE (which also did not work).

It would appear that the remote debugger is flaky (or possibly just picky) in its ability to load rsm (remote symbols) files - they are still looking into why mine wont load. My rsm file is big at around 50Mb although this is no problem for Delphi 7's remote debugger.

The work around involved upgrading to Delphi XE and then choosing the compiler link option 'Place Debug Information in separate TDS file'. This seems to create a tds file onthe remote target instead of a rsm file and breakpoints then work fine.

I've submitted my rsm and tds files to Embarcadero for investigation as to why this happens.

Brian Frost
  • 13,334
  • 11
  • 80
  • 154
  • 2
    Plus 1 and a note of thanks for posting this! I had the exact same problem with a relatively complex program (COM Client/Servers, DLL + EXE). Setting RemoteDebugSymbols False (and using the TDS option instead), allowed me to remote debug. NOTE: I also had to delete the old RSM File from the server. Interestingly Simple test EXE's were remote debugging just fine with RSM files. – sse Feb 05 '14 at 20:23
  • 1
    Just had the same issue - @sse : had to delete the remote .rsm file after switching to TDS. Brilliant. Thanks both. – J... Sep 14 '16 at 11:39
  • Thank you all - I can verify that this is still a valid answer using Delphi XE6. This was the only thing that worked for me! – Brian Riley Apr 11 '19 at 20:06
5

What Windows OS? Maybe run rmtdbg140.exe as admin.

I run D2010 remote debugging on XP versus XP. My How-To is at http://blog.runbits.com/post/Remote-debugging-Delphi.aspx

netcodecz
  • 312
  • 2
  • 9
  • Yes I saw your useful information and followed your steps exactly because I wanted to get to your conclusion "you can set breakpoints or everything like during normal debugging. And this is all". No luck. I am running Windows XP-32 bit as a target and have run rmtdbg140.exe from a command window using Run As Administrator. Thanks for your comments. " – Brian Frost Feb 18 '11 at 09:20
  • 1
    I upload small demo - http://blog.runbits.com/img/remote-debugger/remote.zip - tested from XP3 Prof again Windows 2000 (in VmWare). Uploaded files from How-to to separate disrectory, registered as in how to and worked. Everything for debugger is in one directory. – netcodecz Feb 18 '11 at 22:26
  • 1
    bccide.dll - 14.0.3593.25826, bordbk140.dll - 140.909.17.16318, bordbk140N.dll - 140.909.17.16318, comp32x.dll - 6.21.3615.26516, DCC140.dll - 14.0.3593.25826, rmtdbg140.exe - 140.909.17.16318. All in one directory - c:\todebug – netcodecz Feb 18 '11 at 22:36
  • Great! It works. Your remark "Everything for debugger is in one directory" led me to put all debugger files into same 'c:\todebug' as project1.exe and project1.rsm and breakpoints work!!!!!! I now need to verify whether its the 'same directory' effect that solved it - this may be it because your demo looks identical to mine. I'll post my findings here, and in the meantime your answer is accepted, thanks. – Brian Frost Feb 20 '11 at 11:28
  • Well, some success but it is very flaky. I managed to see a simple application of mine working, but then it comes and goes. There is definitely some dependency on what has gone before, but I just cant nail it. – Brian Frost Feb 22 '11 at 17:47
0

It is imperative to have correct time zone and clock on remote system. In my case I set up remote debugging and when I load process the breakpoints turned green. I checked remote system timezone and clock, set it right and remote dubugger worked again.

Marko
  • 1
  • 1
0

I had this problem. Installing Update 4 for Delphi 2010 solved my problem. It is also listed in the list of fixed problems of Update 4.

smndk
  • 1