PDA

View Full Version : Debugging with Lazarus



Sly
30-06-2005, 03:17 AM
I've built Lazarus from CVS with FPC 2.0.0. So now I can start Lazarus and run applications. But if I set the Debugger Options to tell it where gdb.exe is located, running a program now starts gdb.exe and goes no further. The application does not show and I have to reset the debugger from the IDE. And I still cannot set a breakpoint, run to cursor, step, or anything like that. Those menu items are greyed out.

How do I debug under Lazarus with GDB?

cairnswm
30-06-2005, 04:44 AM
I tried it once long ago and then gave up - Its the main reason I'm still using Delphi instead of Lazarus :)

Anyway I am not sure that Lazarus can be compiled with FPC 2.0.... I am on the Lazarus mailing list but read hardly any of the mails (there are about 50 per day).

Sorry

Sly
30-06-2005, 04:46 AM
It compiled fine, and it runs fine, except for getting this debugger working.

WILL
30-06-2005, 09:45 PM
So I guess it's safe to say that the next major fix the Lazarus team to work on would be the debugger.

Or so it seems to be the one that most people seem to want.

Sly
30-06-2005, 10:26 PM
I got a reply on the Lazarus mailing list that it works better with some versions of gdb than others, ie. MinGW's is better than Cygwin's. Don't know how well FPC's version of gdb rates.

It is a shame that a lot of open source software degenerates into a mess of "you must have version x.y.z of library abc in order to get software blah working correctly. Version x.y.z+/-1 will not work".

Almindor
01-07-2005, 10:30 AM
Well, that last blabber of yours was really helpful. In any case minGW debugger works. FPC 2.0 works too. See my guide for getting things working right.(on free pascal part of forums, it's sticky)

As to the versioning, it's not FPCs fault. It's actualy a windows/gnu problem, go tell bill and stalman.

WILL
01-07-2005, 08:39 PM
Well true Sly didn't offer up much of a solution to the issue, But he did point out where some of the problem lies.

Is there a way to get a version that works on both Windows and Lazarus? Not nessissarily the latest one, but a dependable one. I mean how radically different are the different versions of GDB?

Is there a debugger that has common enough functionality in Windows, Linux and Mac OS X that it can be standardized to come with Lazarus being pre-setup on installation?

Almindor
04-07-2005, 07:59 AM
Yes, IIRC version 6.x from mingw works. It's a bit hidden in the downloads sections as it's considered unstable(it works as good as linux one for me).

About that "open source version x does not work with version y". Well if you really take everything into consideration it's quite a miracle so many things work as they do. Take delphi for example. One OS, one architecture, self-made debugger, no external 3rd party programs to be dependent on.

Now take Lazarus. 3 Oses, 2 architectures, therefor internal debugger is huge effort which IMO is not worth it considering gdb is everywhere.

You're comparing apples and oranges. If FPC and Lazarus concentrated on one platform they would work tip-top all the time too.

Sly
04-07-2005, 09:23 AM
The comment was aimed at the differences between different distributions of gdb. The MinGW version (gdb 5.2.1) works with Lazarus, but the version supplied with FreePascal 2.0.0 (gdb 6.2.1) does not. The release notes supplied with the MinGW version mention that he made some changes which make it work it better in Windows. Well then, why don't other distributions pick up those changes? Where does FPC's gdb version come from? If the Lazarus project is so closely tied to the FPC project, why can't the Lazarus team campaign for FPC to distribute a compatible version of gdb?

Yes, I was frustrated at the time. This is not the first time that I have come across version hell with open source libraries and software (mostly to do with trying to setup Linux servers).

Lightning
19-07-2005, 02:19 PM
I'm one of the guys for wich debugging didn't work for quite some time, now it works "out of the box" i don't set anything and it just works, try getting the snapshot from http://www.ca.freepascal.org/Lazarus
I didn't care about debugger much since i only use breakpoints and i can always user WriteLn or ShowMessage in some parts of the code where i think there are problems.
From what i know the debugger always worked on Linux without any special setup and now it works fine in win32 too.

marmin
19-08-2005, 06:09 PM
Debugging in Lazarus is a weak point.

WILL
19-08-2005, 07:45 PM
Well what is the 'roadmap' with concerns to debugging features and improvements in the upcoming Lazarus versions? (Lazarus 0.9.9 and 1.0.0...)