Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging a Delphi app on Wine

I have a Delphi Windows app that dies horribly under Wine - doesn't even get to creating the main form. Porting to Free Pascal is not an option for various reasons.

Can I debug under Wine using Delphi's native means? If not, can I debug under Wine using gdb, and if so, how do I feed the debug info in Delphi format (Turbo Debugger probably) to gdb?

Finally, how can I detect Wine from a program? The Wine FAQ says I should not, but I don't think that fixing my app is high on the Wine guys' priority list, so I'd rather take the matters in my own hands.

I did not write the app, but I have the sources and a copy of Delphi.

like image 550
Seva Alekseyev Avatar asked Jan 06 '10 20:01

Seva Alekseyev


2 Answers

I do believe you should be able to debug with gdb, but I don't know how you would feed all the Delphi sources to it. You would need to include all debug information in your EXE (including External debugger) to get started though.

I would recommend you get a logging utility that supports logging over TCP/IP. Two good ones are SmartInspect and CodeSite. Combine those with a stack tracing utility like the JCL provides and you might find it is a better solution then attaching the debugger anyway.

  • CodeSite
    (source: raize.com)

  • Smart Inspect
    (source: gurock.com)

Good luck on detecting Wine though. I would be curious to see what you come up with. Seems like it should be possible though.

like image 154
Jim McKeeth Avatar answered Sep 24 '22 01:09

Jim McKeeth


You might be able to get the remote debugger to connect to the Wine app (never tried it), but that's asking a lot of Wine.

The first thing I'd try is using a stack tracing utility like the JCL debugging extensions. A stack trace may give you enough information to fix the issue without having to get debugging working under Linux.

like image 22
Craig Stuntz Avatar answered Sep 25 '22 01:09

Craig Stuntz