mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-03 11:19:36 +01:00
* updated for new deref info
This commit is contained in:
parent
77d641fa2a
commit
ff431f21ae
@ -434,94 +434,88 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function readderef(const s:string;skipnil:boolean):boolean;
|
procedure readderef;
|
||||||
type
|
type
|
||||||
tdereftype = (derefnil,derefaktrecordindex,derefaktstaticindex,
|
tdereftype = (derefnil,
|
||||||
derefunit,derefrecord,derefindex,
|
derefaktrecordindex,
|
||||||
dereflocal,derefpara,derefaktlocalindex);
|
derefaktstaticindex,
|
||||||
|
derefaktglobalindex,
|
||||||
|
derefaktlocalindex,
|
||||||
|
derefunit,
|
||||||
|
derefrecord,
|
||||||
|
derefindex,
|
||||||
|
dereflocal,
|
||||||
|
derefpara
|
||||||
|
);
|
||||||
var
|
var
|
||||||
b : tdereftype;
|
b : tdereftype;
|
||||||
|
first : boolean;
|
||||||
|
idx : word;
|
||||||
|
typ,
|
||||||
|
i,n : byte;
|
||||||
|
s : string;
|
||||||
begin
|
begin
|
||||||
readderef:=true;
|
first:=true;
|
||||||
repeat
|
i:=0;
|
||||||
b:=tdereftype(ppufile.getbyte);
|
n:=ppufile.getbyte;
|
||||||
case b of
|
if n<1 then
|
||||||
derefnil :
|
begin
|
||||||
begin
|
writeln('!! Error, deref len < 1');
|
||||||
if not skipnil then
|
exit;
|
||||||
writeln('nil');
|
end;
|
||||||
readderef:=false;
|
typ:=ppufile.getbyte;
|
||||||
break;
|
case typ of
|
||||||
end;
|
0 : write('Nil');
|
||||||
derefaktrecordindex :
|
1 : s:='Symbol';
|
||||||
begin
|
2 : s:='Definition';
|
||||||
writeln('AktRecord ',s,' ',ppufile.getword);
|
else write('!! Error, unknown deref destination type');
|
||||||
break;
|
end;
|
||||||
end;
|
inc(i);
|
||||||
derefaktstaticindex :
|
while (i<n) do
|
||||||
begin
|
begin
|
||||||
writeln('AktStatic ',s,' ',ppufile.getword);
|
if not first then
|
||||||
break;
|
write(', ')
|
||||||
end;
|
else
|
||||||
derefaktlocalindex :
|
first:=false;
|
||||||
begin
|
b:=tdereftype(ppufile.getbyte);
|
||||||
writeln('AktLocal ',s,' ',ppufile.getword);
|
idx:=ppufile.getbyte shl 8;
|
||||||
break;
|
idx:=idx or ppufile.getbyte;
|
||||||
end;
|
inc(i,3);
|
||||||
derefunit :
|
case b of
|
||||||
begin
|
derefnil :
|
||||||
writeln('Unit ',ppufile.getword);
|
write('!! Error (nil)');
|
||||||
break;
|
derefaktrecordindex :
|
||||||
end;
|
write('AktRecord ',s,' ',idx);
|
||||||
derefrecord :
|
derefaktstaticindex :
|
||||||
begin
|
write('AktStatic ',s,' ',idx);
|
||||||
write('RecordDef ',ppufile.getword,', ');
|
derefaktglobalindex :
|
||||||
end;
|
write('AktGlobal ',s,' ',idx);
|
||||||
derefpara :
|
derefaktlocalindex :
|
||||||
begin
|
write('AktLocal ',s,' ',idx);
|
||||||
write('Parameter of procdef ',ppufile.getword,', ');
|
derefunit :
|
||||||
end;
|
write('Unit ',idx);
|
||||||
dereflocal :
|
derefrecord :
|
||||||
begin
|
write('RecordDef ',idx);
|
||||||
write('Local of procdef ',ppufile.getword,', ');
|
derefpara :
|
||||||
end;
|
write('Parameter of procdef ',idx);
|
||||||
derefindex :
|
dereflocal :
|
||||||
begin
|
write('Local of procdef ',idx);
|
||||||
write(s,' ',ppufile.getword,', ');
|
derefindex :
|
||||||
end;
|
write(s,' ',idx);
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
writeln('!! unsupported dereftyp: ',ord(b));
|
writeln('!! unsupported dereftyp: ',ord(b));
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
until false;
|
end;
|
||||||
end;
|
writeln;
|
||||||
|
|
||||||
|
|
||||||
function readdefref:boolean;
|
|
||||||
begin
|
|
||||||
readdefref:=readderef('Definition',false);
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
function readsymref:boolean;
|
|
||||||
begin
|
|
||||||
readsymref:=readderef('Symbol',false);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure readtype;
|
procedure readtype;
|
||||||
var
|
|
||||||
b1,b2 : boolean;
|
|
||||||
begin
|
begin
|
||||||
b1:=readderef('Definition',true);
|
readderef;
|
||||||
b2:=readderef('Symbol',true);
|
|
||||||
if not(b1 or b2) then
|
|
||||||
Writeln('nil')
|
|
||||||
else
|
|
||||||
if (b1 and b2) then
|
|
||||||
Writeln('!! Type has both definition and symbol stored');
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -543,7 +537,7 @@ const
|
|||||||
var
|
var
|
||||||
sl : tsltype;
|
sl : tsltype;
|
||||||
begin
|
begin
|
||||||
readdefref;
|
readderef;
|
||||||
repeat
|
repeat
|
||||||
sl:=tsltype(ppufile.getbyte);
|
sl:=tsltype(ppufile.getbyte);
|
||||||
if sl=sl_none then
|
if sl=sl_none then
|
||||||
@ -553,7 +547,7 @@ begin
|
|||||||
sl_call,
|
sl_call,
|
||||||
sl_load,
|
sl_load,
|
||||||
sl_subscript :
|
sl_subscript :
|
||||||
readsymref;
|
readderef;
|
||||||
sl_vec :
|
sl_vec :
|
||||||
writeln(ppufile.getlongint);
|
writeln(ppufile.getlongint);
|
||||||
end;
|
end;
|
||||||
@ -783,9 +777,9 @@ begin
|
|||||||
write (space,' Type : ');
|
write (space,' Type : ');
|
||||||
readtype;
|
readtype;
|
||||||
write (space,' Default : ');
|
write (space,' Default : ');
|
||||||
readsymref;
|
readderef;
|
||||||
write (space,' Symbol : ');
|
write (space,' Symbol : ');
|
||||||
readsymref;
|
readderef;
|
||||||
writeln(space,' Is Hidden : ',(ppufile.getbyte<>0));
|
writeln(space,' Is Hidden : ',(ppufile.getbyte<>0));
|
||||||
write (space,' Location : ');
|
write (space,' Location : ');
|
||||||
writeln('<not yet implemented>');
|
writeln('<not yet implemented>');
|
||||||
@ -820,7 +814,7 @@ begin
|
|||||||
writeln(space,'** Definition Nr. ',ppufile.getword,' **');
|
writeln(space,'** Definition Nr. ',ppufile.getword,' **');
|
||||||
writeln(space,s);
|
writeln(space,s);
|
||||||
write (space,' Type symbol : ');
|
write (space,' Type symbol : ');
|
||||||
readsymref;
|
readderef;
|
||||||
ppufile.getsmallset(defopts);
|
ppufile.getsmallset(defopts);
|
||||||
|
|
||||||
if df_unique in defopts then
|
if df_unique in defopts then
|
||||||
@ -829,12 +823,12 @@ begin
|
|||||||
if df_has_rttitable in defopts then
|
if df_has_rttitable in defopts then
|
||||||
begin
|
begin
|
||||||
write (space,' RTTI symbol : ');
|
write (space,' RTTI symbol : ');
|
||||||
readsymref;
|
readderef;
|
||||||
end;
|
end;
|
||||||
if df_has_inittable in defopts then
|
if df_has_inittable in defopts then
|
||||||
begin
|
begin
|
||||||
write (space,' Init symbol : ');
|
write (space,' Init symbol : ');
|
||||||
readsymref;
|
readderef;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -922,9 +916,12 @@ begin
|
|||||||
ibprocsym :
|
ibprocsym :
|
||||||
begin
|
begin
|
||||||
readcommonsym('Procedure symbol ');
|
readcommonsym('Procedure symbol ');
|
||||||
repeat
|
len:=ppufile.getword;
|
||||||
write(space,' Definition: ');
|
for i:=1 to len do
|
||||||
until not readdefref;
|
begin
|
||||||
|
write(space,' Definition: ');
|
||||||
|
readderef;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ibconstsym :
|
ibconstsym :
|
||||||
@ -1021,7 +1018,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
readcommonsym('Enumeration symbol ');
|
readcommonsym('Enumeration symbol ');
|
||||||
write (space,' Definition: ');
|
write (space,' Definition: ');
|
||||||
readdefref;
|
readderef;
|
||||||
writeln(space,' Value: ',getlongint);
|
writeln(space,' Value: ',getlongint);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1078,7 +1075,7 @@ begin
|
|||||||
if (i and 32)>0 then
|
if (i and 32)>0 then
|
||||||
begin
|
begin
|
||||||
write (space,'OverrideProp: ');
|
write (space,'OverrideProp: ');
|
||||||
readsymref;
|
readderef;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1320,9 +1317,9 @@ begin
|
|||||||
writeln(space,' Overload Number : ',getword);
|
writeln(space,' Overload Number : ',getword);
|
||||||
writeln(space,' Number : ',getword);
|
writeln(space,' Number : ',getword);
|
||||||
write (space,' Class : ');
|
write (space,' Class : ');
|
||||||
readdefref;
|
readderef;
|
||||||
write (space,' Procsym : ');
|
write (space,' Procsym : ');
|
||||||
readsymref;
|
readderef;
|
||||||
write (space,' File Pos : ');
|
write (space,' File Pos : ');
|
||||||
readposinfo;
|
readposinfo;
|
||||||
write (space,' SymOptions : ');
|
write (space,' SymOptions : ');
|
||||||
@ -1330,7 +1327,7 @@ begin
|
|||||||
if (calloption=pocall_inline) then
|
if (calloption=pocall_inline) then
|
||||||
begin
|
begin
|
||||||
write (space,' FuncretSym : ');
|
write (space,' FuncretSym : ');
|
||||||
readdefref;
|
readderef;
|
||||||
end;
|
end;
|
||||||
space:=' '+space;
|
space:=' '+space;
|
||||||
{ parast }
|
{ parast }
|
||||||
@ -1412,7 +1409,7 @@ begin
|
|||||||
writeln(space,' Vmt offset : ',getlongint);
|
writeln(space,' Vmt offset : ',getlongint);
|
||||||
writeln(space,' Name of Class : ',getstring);
|
writeln(space,' Name of Class : ',getstring);
|
||||||
write(space, ' Ancestor Class : ');
|
write(space, ' Ancestor Class : ');
|
||||||
readdefref;
|
readderef;
|
||||||
writeln(space,' Options : ',getlongint);
|
writeln(space,' Options : ',getlongint);
|
||||||
|
|
||||||
if tobjectdeftype(b) in [odt_interfacecom,odt_interfacecorba] then
|
if tobjectdeftype(b) in [odt_interfacecom,odt_interfacecorba] then
|
||||||
@ -1431,7 +1428,7 @@ begin
|
|||||||
for j:=1 to l do
|
for j:=1 to l do
|
||||||
begin
|
begin
|
||||||
write (space,' - Definition : ');
|
write (space,' - Definition : ');
|
||||||
readdefref;
|
readderef;
|
||||||
writeln(space,' IOffset : ',getlongint);
|
writeln(space,' IOffset : ',getlongint);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1468,7 +1465,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
readcommondef('Enumeration type definition');
|
readcommondef('Enumeration type definition');
|
||||||
write(space,'Base enumeration type : ');
|
write(space,'Base enumeration type : ');
|
||||||
readdefref;
|
readderef;
|
||||||
writeln(space,' Smallest element : ',getlongint);
|
writeln(space,' Smallest element : ',getlongint);
|
||||||
writeln(space,' Largest element : ',getlongint);
|
writeln(space,' Largest element : ',getlongint);
|
||||||
writeln(space,' Size : ',getlongint);
|
writeln(space,' Size : ',getlongint);
|
||||||
@ -1679,12 +1676,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
ibsymref :
|
ibsymref :
|
||||||
begin
|
begin
|
||||||
readsymref;
|
readderef;
|
||||||
readref;
|
readref;
|
||||||
end;
|
end;
|
||||||
ibdefref :
|
ibdefref :
|
||||||
begin
|
begin
|
||||||
readdefref;
|
readderef;
|
||||||
readref;
|
readref;
|
||||||
if ((ppufile.header.flags and uf_local_browser)<>0) and
|
if ((ppufile.header.flags and uf_local_browser)<>0) and
|
||||||
(UnitIndex=0) then
|
(UnitIndex=0) then
|
||||||
@ -1940,7 +1937,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.43 2003-06-05 20:06:11 peter
|
Revision 1.44 2003-06-09 12:59:00 peter
|
||||||
|
* updated for new deref info
|
||||||
|
|
||||||
|
Revision 1.43 2003/06/05 20:06:11 peter
|
||||||
* new procoptions
|
* new procoptions
|
||||||
|
|
||||||
Revision 1.42 2003/05/09 17:47:03 peter
|
Revision 1.42 2003/05/09 17:47:03 peter
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user