9

I am attempting to use WinDBG or another debugger to debug a CodeGear Delphi 2007 Windows application on a remote machine. I have been unable to produce symbol files for WinDBG.

Is there a way to use WinDBG or another debugger to debug Delphi applications on a system that doesn't include the IDE?

Edit1

The remote debugger is not an option here. I am able to remote in to the end user PC, but I am unable to use the remote debugger due to firewall restrictions.

Edit2

I am able to remote in to the machine, but can not connect the CodeGear remote debugger due to firewall restrictions.

7 Answers 7

6

How about the remote debugger? Build your app with remote debug symbols and debug from your development machine across the network.

Sign up to request clarification or add additional context in comments.

3 Comments

I would love to be able to do this, but regretfully the other machine is on a completely different network with firewall restrictions.
I have been able to remote in to the PC, but I am unable to connect the Remote Debugger through TCP\IP. I was looking at something similar to WinDBG to troubleshoot the application through the GUI since I can't directly connect the debugger.
If you can't connect remotely, then I like X-Ray's idea. madExcept rocks.
5

instead, i rely on MadExcept stack tracing and some logging features. my application is distributed worldwide & this has been sufficient.

1 Comment

I looked in to this product a little more and I'm pretty impressed with what it can do! Regretfully, the application isn't crashing. I'm needing a way to dump the memory or walk the application to catch a more logical error occurring. Thank you for the interesting product though!
4

You can try generating a map file and then convert it to a dbg file using map2dbg from http://code.google.com/p/map2dbg/

Then you can load the dbg file in WinDbg.

Disclaimer: I had faced a similar issue but I managed to do remote debugging and didn't have to do all this. So I am not sure this will work. But if you try it then do let us know if it works.

1 Comment

I looked in to this quite a bit yesterday and discovered that it isn't compatible with Delphi yet. If you've got any more information on it, this would be perfect.
2

I'm afraid this is one more of those "I don't have an actual answer" answers, but it might just help...

Have you considered adding logging to your application? I've heard great things about SmartInspect. With it, you can log all sorts of information, including stack traces and "watches" (variables).

Another logging product for Delphi is EurekaLog.

1 Comment

I can confirm that SmartInspect is a very reliable solution. Ok, you cannot singlestep debug with it the logging is very good and advanced.
1

In Delphi you could use Run -> Attach to Process, select the remote machine and select the process you'd like to debug.

2 Comments

... asuming the target machine is running the remote debugger.
I've never used this "procedure" so I didn't think of it. Thx for setting it straight, at least "I"'ve learned something.
1

http://sourceforge.net/projects/tds2dbg/ can be used to convert Delphi's TDS debug files to DBG files. This gives basic symbol information -- functions, classes, units, but not variables. Enough for a reasonable call stack, and with a bit of knowledge, enough to debug Delphi apps live and with dumps.

I've written about some of Delphi+WinDBG experiences on my blog: https://marc.durdin.net/2015/11/windbg-and-delphi-a-collection-of-posts/

Comments

0

Thank you all for the great suggestions and interesting products.

To solve this specific issue, the "best" way I found uses the OutputDebugString located in the Windows namespace. This, along with Debug View from Sysinternals, will allow me to gather debug information and sort through it pretty quickly.

If you decide to use this method, make sure everything is wrapped in ANSI formatting. IE:

OutputDebugString(PAnsiChar(string1 + string2));

This makes sure that string1 and string2 are combined and then converted in to ANSI Characters.

I probably should have just started dumping text to a file for something quick and dirty, but this will allow a non-debugging version to emit debugging messages.

1 Comment

I want to leave this question open for a few more days to see if we can't get a better answer than this to actually connect the debugger.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.