[fpc-pascal] Re: fcl-passrc package question about source file and line number info

Seth Grover sethdgrover at gmail.com
Wed Jul 18 20:29:32 CEST 2012


Hm, it's still failing for me.

Here's what I get with test_parser from examples given this input:

===================================================
unit timelib;

{$mode objfpc}{$H+}

interface

implementation


procedure SmonthToCmonth (const sMonth : array of char;
                          const stDex  : longword;
                          out   cVal   : longword);
begin
  case sMonth[stDex] of
    'J' : cVal := 0;
  end;
end;

end.
===================================================

Here's the program output:

$ ./test_parser timelib.pas
Unit timelib;

Interface


Implementation


Procedure SmonthToCmonth(const sMonth: Array of Char; const stDex:
LongWord; out cVal: LongWord);
begin
 case sMonth[stDex] of
   'J':  cVal:= 0;
 end;
end;

end.
An unhandled exception occurred at $0000000000000000 :
EAccessViolation : Access violation
  $0000000000000000
  $0000000000480B72 line 1872 of pastree.pp
  $00000000004854D3 line 2740 of pastree.pp
  $0000000000419892
  $0000000000480B72 line 1872 of pastree.pp
  $0000000000485186 line 2703 of pastree.pp
  $0000000000419892
  $0000000000480B72 line 1872 of pastree.pp
  $0000000000419892
  $0000000000485001 line 2672 of pastree.pp
  $0000000000419892
  $00000000004800AB line 1747 of pastree.pp
  $0000000000419892
  $000000000047DF2E line 1425 of pastree.pp
  $0000000000484D5D line 2652 of pastree.pp
  $0000000000419892
  $000000000047DFDB line 1436 of pastree.pp

Here's the GDB backtrace:

(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000000419892 in SYSTEM_TOBJECT_$__FREE ()
#2  0x00007ffff7f965c0 in ?? ()
#3  0x000000000047d819 in RELEASE (this=0x7ffff7f965c0) at pastree.pp:1332
#4  0x0000000000480b72 in DESTROY (this=0x7ffff7f96540, vmt=0x0) at
pastree.pp:1872
#5  0x00000000004854d3 in DESTROY (this=0x7ffff7f96540, vmt=0x1) at
pastree.pp:2740
#6  0x0000000000419892 in SYSTEM_TOBJECT_$__FREE ()
#7  0x00007ffff7f96458 in ?? ()
#8  0x000000000047d819 in RELEASE (this=0x7ffff7f96540) at pastree.pp:1332
#9  0x0000000000480b72 in DESTROY (this=0x7ffff7f964c0, vmt=0x0) at
pastree.pp:1872
#10 0x0000000000485186 in DESTROY (this=0x7ffff7f964c0, vmt=0x1) at
pastree.pp:2703
#11 0x0000000000419892 in SYSTEM_TOBJECT_$__FREE ()
#12 0x00007ffff7fa6620 in ?? ()
#13 0x000000000047d819 in RELEASE (this=0x7ffff7f964c0) at pastree.pp:1332
#14 0x0000000000480b72 in DESTROY (this=0x7ffff7f9e2e0, vmt=0x1) at
pastree.pp:1872
#15 0x0000000000419892 in SYSTEM_TOBJECT_$__FREE ()
#16 0x0000000000000002 in ?? ()
#17 0x000000000047d819 in RELEASE (this=0x7ffff7f9e2e0) at pastree.pp:1332
#18 0x0000000000485001 in DESTROY (this=0x7ffff7f86040, vmt=0x1) at
pastree.pp:2672
#19 0x0000000000419892 in SYSTEM_TOBJECT_$__FREE ()
#20 0x00007ffff7fa6400 in ?? ()
#21 0x000000000047d819 in RELEASE (this=0x7ffff7f86040) at pastree.pp:1332
#22 0x00000000004800ab in DESTROY (this=0x7ffff7f961c0, vmt=0x1) at
pastree.pp:1747
#23 0x0000000000419892 in SYSTEM_TOBJECT_$__FREE ()
#24 0xffffffffffffffff in ?? ()
#25 0x000000000047d819 in RELEASE (this=0x7ffff7f961c0) at pastree.pp:1332
#26 0x000000000047df2e in DESTROY (this=0x7ffff7fb6180, vmt=0x0) at
pastree.pp:1425
#27 0x0000000000484d5d in DESTROY (this=0x7ffff7fb6180, vmt=0x1) at
pastree.pp:2652
#28 0x0000000000419892 in SYSTEM_TOBJECT_$__FREE ()
#29 0x00007fffffffe0d0 in ?? ()
#30 0x000000000047d819 in RELEASE (this=0x7ffff7fb6180) at pastree.pp:1332
#31 0x000000000047dfdb in DESTROY (this=0x7ffff7f96140, vmt=0x1) at
pastree.pp:1436
#32 0x0000000000419892 in SYSTEM_TOBJECT_$__FREE ()
#33 0x00000000006dd268 in U_SYSTEM_OUTPUT ()
#34 0x000000000044369e in SYSUTILS_FREEANDNIL$formal ()
#35 0x00007fffffffe0d0 in ?? ()
#36 0x00000000004099fa in main () at test_parser.pp:1985

I'm doing it in Linux compiling for x86_64. There wouldn't be any
problem with me using this package source (pastree, paswrite, pparser,
pscanner) with FPC 2.6.0 would there? I am using FPC 2.6.0, but just
compiling this one package from svn in trunk separately.

-SG

--
This email is fiction. Any resemblance to actual events
or persons living or dead is purely coincidental.

Seth Grover



More information about the fpc-pascal mailing list