Forum > General

Can I setup Lazarus to use Virtual Pascal compiler and still debug?

(1/3) > >>


I have a old DOS Borland 7 project that used TurboPower Professional.  I was able to use Virtual Pascal to get it built by using their TurboPower Object Professional port (OP) and some minor modifications to some of the old TP units like TPWindow, TPMenu, .. but the old DOS IDE isn't very nice. 

I have Notepad++ setup to be able to build and highlight errors where you can double click to go to the file/line but I can't debug with that.   

So I'm trying Lazarus with Free Pascal but I know I'll have some porting issues with things used from the old Borland CRT like FastWrite and FastWriteWindow (Gnu Pascal supports those but it requires NCurses/PDCurses under Windows) so I thought, if Lazarus could be used as both the editor and debugger, it be great, I could deal with this port to Windows console application using Virtual Pascal and use Free Pascal for new projects.

So the main question is, Can Lazarus be used to build with Virtual Pascal and be used to Debug the applications?

If so, How do I set that up?


No. And even if there were a theoretical possibility it would be magnitudes more complicated than fixing your porting issues.

Compiler and debugger are tightly connected, and specially for older products often quite unique. Newer targets (like x86_64) are often more homogenous as all compilers usually adhere to the vendors ABI and other platform defaults.

For debugging it would need to generate DWARF debug info. (Or "stabs" if you use the gdb based debugging).

If you have a compiled exe: objdump --dwarf=info  your.exe
will show if there is any dwarf.

If there is, you can open the project (create a project for it), and use "Run Params" > "Host app" to point to the already compiled exe.
(Disable compiling for the project)

It's all good and fine with Virtual Pascal, except that there is limitation to project size that Virtual Pascal can handle. I do not remember exactly, but 10k, 15k or 20k lines and you wont be able compile your project due to some internal error. That error wont be fixed, and it's not open source project where you could do something about it by yourself.
Playing around with Virtual Pascal is ok, but not much more.


--- Quote from: marcov on February 14, 2023, 09:10:57 am ---No. And even if there were a theoretical possibility it would be magnitudes more complicated than fixing your porting issues.

--- End quote ---

Noting Martin's and Mika's answers, since Lazarus is arguably the best available RAD IDE perhaps expanding it to support more compilers and languages would be a worthwhile goal.

The IDE, i.e. editor and debugger, is IMO at least as good as Eclipse and its open nature makes it attractive relative to MS Visual Studio. The form designer, generating XML and provably useful for multiple target OSes etc., is sufficiently capable that other language communities might consider implementing their own class libraries.



[0] Message Index

[#] Next page

Go to full version