~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to fcl/tests/dbugsrv.pp

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
program dbugsrv;
 
2
 
 
3
{$MODE OBJFPC}
 
4
{$H+}
 
5
{$APPTYPE CONSOLE}
 
6
 
 
7
uses
 
8
  classes,SysUtils,simpleipc,dbugmsg;
 
9
 
 
10
Var
 
11
  Srv : TSimpleIPCServer;
 
12
  S : String;
 
13
  Msg : TDebugMessage;
 
14
  
 
15
begin
 
16
  Srv:=TSimpleIPCServer.Create(Nil);
 
17
  Try
 
18
    Srv.ServerID:=DebugServerID;
 
19
    Srv.Global:=True;
 
20
    Srv.Active:=True;
 
21
    Srv.StartServer;
 
22
    Writeln('Server started. Listening for debug messages');
 
23
    Repeat
 
24
      If Srv.PeekMessage(1,True) then
 
25
        begin
 
26
        Srv.MsgData.Seek(0,soFrombeginning);
 
27
        ReadDebugMessageFromStream(Srv.MsgData,MSg);
 
28
        Write(FormatDateTime('hh:nn:ss.zzz',Msg.MsgTimeStamp),': ');
 
29
        Write(DebugMessageName(MSg.MsgType):12,' ');
 
30
        Writeln(Msg.Msg);
 
31
        end
 
32
      else
 
33
        Sleep(10);
 
34
    Until False;
 
35
  Finally
 
36
    Srv.Free;
 
37
  end;
 
38
end.
 
39