On Thu, 2 Jan 2003 16:17:43 +0100 (CET) :) I think, a remote logger is a very useful tool…
Show quoted text 61 lines
And unit 'Linux'.
Mattias

Mailing lists / lazarus / 2003-01
7 messages · 4 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
On Thu, 2 Jan 2003 16:17:43 +0100 (CET) :) I think, a remote logger is a very useful tool…
And unit 'Linux'.
Mattias
Hi,
Some of you will maybe be familiar with the 'gexperts' package for Delphi. It contains a 'debug server', with a unit 'dbugintf' to communicate with it.
The idea is that, to debug your programs, you include the 'dbugintf' unit
in the unit you wish to debug, and statements like
{$ifdef debug}
senddebug('Passed here') ;
{$endif}
can be put in various locations. (more methods exist, to send variable values etc)The debug server catches the messages sent by the dbugintf unit, and displays them in a nice way.
This is very useful for debugging GUI code: A normal debugger will interfere with the GUI events (focus shifts etc) and so messes up any attempts to debug code. Also daemons (servlets) etc. can use this unit to do debugging.
I made such a debugserver for the kylix book I co-authored, and now I've implemented and extended it for use with Free Pascal.
There are 2 versions:
- Console or system log.
- GTK version (currently uses fpgtk)
Displays all messages nicely in a list, as the original 'gdebug' program. (there are various options which can be set)
Currently, it works on Linux, and it can use a unix domain socket, or a TCP/IP socket. (so you can log to a debugserver on a separate host)
It seems to work nicely. I did a speed test (10000 messages in a tight loop) And all works ok. I've committed the lot under utils/debugsvr.
Question to the Lazarus team:
Currently, there are 2 server front-ends available:
- console (also can use linux system log)
- GTK (uses a thin GTK OOP wrapper: fpgtk)
The server mechanism is available in a separate unit, so it is easy to write a new server which handles the messages differently.
I think it would be a nice idea if someone would look at the GTK interface (it is really small) and produce a Lazarus interface. The GUI code is written in such a way that you will have almost no changes to do.
I think it would even be possible to include the debug server in the lazarus IDE itself, if properly coded.
A win32 version is in the works, I still need to port the ssockets code to windows. AFter that it should work with just a recompile.
Comments, suggestions etc. always welcome.
Michael.
On Thu, 2 Jan 2003 16:17:43 +0100 (CET) :) I think, a remote logger is a very useful tool…
It is polling, but that shouldn't matter. Look at the GTK frontend I wrote, there should be no problem implementing it for Lazarus.
Currently I'm busy, so I can't say when I will do it. Any help is welcome. Michael, can you adapt it for fpc 1.1?
It should work with 1.1 as well as 1.0, since it only uses FCL and some packages.
Michael.
Some of you will maybe be familiar with the 'gexperts' package for Delphi. It contains a…
:)
I think, a remote logger is a very useful tool and a frontend should be added to the IDE. It should be easy to implement, if the server is not polling. Currently I'm busy, so I can't say when I will do it. Any help is welcome.
Michael, can you adapt it for fpc 1.1?
Mattias
On Fri, 3 Jan 2003 17:02:13 +0100 (CET) And unit 'Linux'. Mattias
The Linux unit is not compiled for 1.1. You need a {$ifdef VER1_0}Linux{$else}Unix{$endif}
This can be changed easily, but currently a lot of changes are done in the Unix/Linux…
Only for 1.0.x compilability of 1.1 IIRC.
One can also start using/testing "baseunix", to be independant of unix/linux and future changes (but that requires in code changes also, because of different prefixes etc, but at least it is much closer to being definitive).
I updated the makefile yesterday evening.
On Fri, 3 Jan 2003 17:02:13 +0100 (CET) And unit 'Linux'. Mattias
This can be changed easily, but currently a lot of changes are done in the Unix/Linux RTL, and I prefer to wait with changing this, but normally, the linux unit should work with 1.1 as well ?
Michael