[fpc-pascal]Strange indexing problem - gdb or fpc?

JOHN COPPENS jcoppens at usa.net
Mon Apr 22 17:30:18 CEST 2002


Hi Pierre.

Here's the routine that gave the problems with gdb:

    procedure enterreal(x: real);
    var
      rr: integer;
    begin
      if r = (rmax - 1) then
        fatal(10)
      else begin
        rr := r + 1;
        rconst[rr] := x;
        realindex := 1;
        while rconst[realindex] <> x do
          inc(realindex);
        if realindex > r then
          r := realindex;
      end;
    end;  { enterreal }

(This is part of the didactic Pascal-FC compiler to show concurrent
 processes and inter-process communication - author Alan Burns. I am
 extending this compiler to include a few more modern primitives;
 This routine stores real constants in a table, avoiding duplicates)

 I am on Linux 2.4.17, using fpc 1.0.4, gdb 5.0. 

 When debugging, I get the strange results as described in the previous
message.

John





More information about the fpc-pascal mailing list