722
procedure readcommonsym(const s:string);
724
writeln(space,'** Symbol Nr. ',ppufile.getword,' **');
725
writeln(space,s,ppufile.getstring);
726
write(space,' File Pos : ');
728
write(space,' SymOptions : ');
733
procedure readcommondef(const s:string);
736
df_has_inittable, { init data has been generated }
737
df_has_rttitable, { rtti data has been generated }
740
tdefoptions=set of tdefoption;
742
defopts : tdefoptions;
744
writeln(space,'** Definition Nr. ',ppufile.getword,' **');
746
write (space,' Type symbol : ');
748
ppufile.getsmallset(defopts);
750
if df_unique in defopts then
751
writeln (space,' Unique type symbol');
753
if df_has_rttitable in defopts then
755
write (space,' RTTI symbol : ');
758
if df_has_inittable in defopts then
760
write (space,' Init symbol : ');
677
766
{ Read abstract procdef and return if inline procdef }
679
768
tproccalloption=(pocall_none,
680
pocall_cdecl, { procedure uses C styled calling }
681
pocall_cppdecl, { C++ calling conventions }
682
pocall_compilerproc, { Procedure is used for internal compiler calls }
683
pocall_far16, { Far16 for OS/2 }
684
pocall_fpccall, { FPC default calling }
685
pocall_inline, { Procedure is an assembler macro }
686
pocall_internproc, { Procedure has compiler magic}
687
pocall_palmossyscall, { procedure is a PalmOS system call }
688
pocall_pascal, { pascal standard left to right }
689
pocall_register, { procedure uses register (fastcall) calling }
690
pocall_safecall, { safe call calling conventions }
691
pocall_stdcall, { procedure uses stdcall call }
692
pocall_system { system call }
769
{ procedure uses C styled calling }
771
{ C++ calling conventions }
773
{ Procedure is used for internal compiler calls }
777
{ Old style FPC default calling }
779
{ Procedure is an assembler macro }
781
{ Procedure has compiler magic}
783
{ procedure is a system call, applies e.g. to MorphOS and PalmOS }
785
{ pascal standard left to right }
787
{ procedure uses register (fastcall) calling }
789
{ safe call calling conventions }
791
{ procedure uses stdcall call }
793
{ Special calling convention for cpus without a floating point
794
unit. Floating point numbers are passed in integer registers
795
instead of floating point registers. Depending on the other
796
available calling conventions available for the cpu
797
this replaces either pocall_fastcall or pocall_stdcall.
800
{ Metrowerks Pascal. Special case on Mac OS (X): passes all }
801
{ constant records by reference. }
694
804
tproccalloptions=set of tproccalloption;
695
805
tproctypeoption=(potype_none,
780
902
(mask:po_msgint; str:'MsgInt'),
781
903
(mask:po_exports; str:'Exports'),
782
904
(mask:po_external; str:'External'),
783
(mask:po_savestdregs; str:'SaveStdRegs'),
784
(mask:po_saveregisters; str:'SaveRegisters'),
785
905
(mask:po_overload; str:'Overload'),
786
906
(mask:po_varargs; str:'VarArgs'),
787
(mask:po_leftright; str:'LeftRight'),
788
(mask:po_clearstack; str:'ClearStack'),
789
907
(mask:po_internconst; str:'InternConst'),
790
908
(mask:po_addressonly; str:'AddressOnly'),
791
(mask:po_public; str:'Public')
909
(mask:po_public; str:'Public'),
910
(mask:po_hascallingconvention;str:'HasCallingConvention'),
911
(mask:po_reintroduce; str:'ReIntroduce'),
912
(mask:po_explicitparaloc; str:'ExplicitParaloc'),
913
(mask:po_nostackframe; str:'NoStackFrame'),
914
(mask:po_has_mangledname; str:'HasMangledName'),
915
(mask:po_has_public_name; str:'HasPublicName'),
916
(mask:po_forward; str:'Forward'),
917
(mask:po_global; str:'Global')
794
920
proctypeoption : tproctypeoption;
795
proccalloption : tproccalloption;
796
procoptions : tprocoptions;
923
tempbuf : array[0..255] of byte;
800
925
write(space,' Return type : ');
838
params:=ppufile.getbyte;
839
writeln(space,' Nr of parameters : ',params);
840
for i:=1 to params do
842
writeln(space,' - Parameter ',i);
843
writeln(space,' Spez : ',Varspez2Str(ppufile.getbyte));
844
write (space,' Type : ');
846
write (space,' Default : ');
848
write (space,' Symbol : ');
850
writeln(space,' Is Hidden : ',(ppufile.getbyte<>0));
855
procedure readcommonsym(const s:string);
857
writeln(space,'** Symbol Nr. ',ppufile.getword,' **');
858
writeln(space,s,ppufile.getstring);
859
write(space,' File Pos: ');
861
write(space,' SymOptions: ');
866
procedure readcommondef(const s:string);
869
df_has_inittable, { init data has been generated }
870
df_has_rttitable, { rtti data has been generated }
873
tdefoptions=set of tdefoption;
962
if (po_explicitparaloc in procoptions) then
965
ppufile.getdata(tempbuf,i);
971
{ options for variables }
978
vo_is_const, { variable is declared as const (parameter) and can't be written to }
984
vo_is_result, { special result variable }
986
vo_is_loop_counter, { used to detect assignments to loop counter }
988
vo_has_explicit_paraloc,
992
tvaroptions=set of tvaroption;
993
{ register variable }
994
tvarregable=(vr_none,
999
procedure readabstractvarsym(const s:string;var varoptions:tvaroptions);
1007
varopt : array[1..varopts] of tvaropt=(
1008
(mask:vo_is_C_var; str:'CVar'),
1009
(mask:vo_is_external; str:'External'),
1010
(mask:vo_is_dll_var; str:'DLLVar'),
1011
(mask:vo_is_thread_var; str:'ThreadVar'),
1012
(mask:vo_has_local_copy; str:'HasLocalCopy'),
1013
(mask:vo_is_const; str:'Constant'),
1014
(mask:vo_is_exported; str:'Exported'),
1015
(mask:vo_is_high_para; str:'HighValue'),
1016
(mask:vo_is_funcret; str:'Funcret'),
1017
(mask:vo_is_self; str:'Self'),
1018
(mask:vo_is_vmt; str:'VMT'),
1019
(mask:vo_is_result; str:'Result'),
1020
(mask:vo_is_parentfp; str:'ParentFP'),
1021
(mask:vo_is_loop_counter; str:'LoopCounter'),
1022
(mask:vo_is_hidden_para; str:'Hidden'),
1023
(mask:vo_has_explicit_paraloc;str:'ExplicitParaloc'),
1024
(mask:vo_is_syscall_lib; str:'SysCallLib'),
1025
(mask:vo_has_mangledname; str:'HasMangledName')
875
defopts : tdefoptions;
877
writeln(space,'** Definition Nr. ',ppufile.getword,' **');
879
write (space,' Type symbol : ');
881
ppufile.getsmallset(defopts);
883
if df_unique in defopts then
884
writeln (space,' Unique type symbol');
886
if df_has_rttitable in defopts then
888
write (space,' RTTI symbol : ');
891
if df_has_inittable in defopts then
893
write (space,' Init symbol : ');
1032
writeln(space,' Spez : ',Varspez2Str(ppufile.getbyte));
1033
writeln(space,' Regable : ',Varregable2Str(ppufile.getbyte));
1034
write (space,' Var Type : ');
1036
ppufile.getsmallset(varoptions);
1037
if varoptions<>[] then
1039
write(space,' Options : ');
1041
for i:=1to varopts do
1042
if (varopt[i].mask in varoptions) then
1048
write(varopt[i].str);
1095
readcommonsym('Variable symbol ');
1096
writeln(space,' Spez: ',Varspez2Str(getbyte));
1097
writeln(space,' Address: ',getlongint);
1098
write (space,' Var Type: ');
1101
writeln(space,' Options: ',i);
1102
if (vo_is_C_var in tvaroptions(i)) then
1103
writeln(space,' Mangledname: ',getstring);
1227
readabstractvarsym('Absolute variable symbol ',varoptions);
1228
Write (space,' Relocated to ');
1230
case absolutetyp(b) of
1232
readsymlist(space+' Sym : ');
1234
Writeln('Assembler name : ',getstring);
1237
Write('Address : ',getlongint);
1238
if tsystemcpu(ppufile.header.cpu)=cpu_i386 then
1239
WriteLn(' (Far: ',getbyte<>0,')');
1242
Writeln ('!! Invalid unit format : Invalid absolute type encountered: ',b);
1248
readabstractvarsym('Field Variable symbol ',varoptions);
1249
writeln(space,' Address : ',getlongint);
1254
readabstractvarsym('Global Variable symbol ',varoptions);
1255
write (space,' DefaultConst : ');
1257
if (vo_has_mangledname in varoptions) then
1258
writeln(space,' Mangledname : ',getstring);
1263
readabstractvarsym('Local Variable symbol ',varoptions);
1264
write (space,' DefaultConst : ');
1270
readabstractvarsym('Parameter Variable symbol ',varoptions);
1271
write (space,' DefaultConst : ');
1273
writeln(space,' ParaNr : ',getword);
1274
if (vo_has_explicit_paraloc in varoptions) then
1108
1283
readcommonsym('Enumeration symbol ');
1109
write (space,' Definition: ');
1284
write (space,' Definition : ');
1111
writeln(space,' Value: ',getlongint);
1286
writeln(space,' Value : ',getlongint);
1116
1291
readcommonsym('Internal system symbol ');
1117
writeln(space,' Internal Nr: ',getlongint);
1292
writeln(space,' Internal Nr : ',getlongint);
1122
1297
readcommonsym('RTTI symbol ');
1123
writeln(space,' RTTI Type: ',getbyte);
1298
writeln(space,' RTTI Type : ',getbyte);
1303
readcommonsym('Macro symbol ');
1304
writeln(space,' Name: ',getstring);
1305
writeln(space,' Defined: ',getbyte);
1306
writeln(space,' Compiler var: ',getbyte);
1308
writeln(space,' Value length: ',len);
1314
writeln(space,' Value: "',pc,'"');
1126
1319
ibtypedconstsym :
1128
1321
readcommonsym('Typed constant ');
1129
write (space,' Constant Type: ');
1131
writeln(space,' ReallyConst: ',(getbyte<>0));
1136
readcommonsym('Absolute variable symbol ');
1137
writeln(space,' Type: ',getbyte);
1138
writeln(space,' Address: ',getlongint);
1139
write (space,' Var Type: ');
1141
writeln(space,' Options: ',getlongint);
1142
Write (space,' Relocated to ');
1144
case absolutetyp(b) of
1146
Writeln('Name : ',getstring);
1148
Writeln('Assembler name : ',getstring);
1151
Write('Address : ',getlongint);
1152
WriteLn(' (Far: ',getbyte<>0,')');
1155
Writeln ('!! Invalid unit format : Invalid absolute type encountered: ',b);
1322
write (space,' Constant Type : ');
1324
writeln(space,' ReallyConst : ',(getbyte<>0));
1159
1327
ibpropertysym :
1161
1329
readcommonsym('Property ');
1163
writeln(space,' PropOptions: ',i);
1331
writeln(space,' PropOptions : ',i);
1164
1332
if (i and 32)>0 then
1166
write (space,'OverrideProp: ');
1334
write (space,' OverrideProp : ');
1171
write (space,' Prop Type: ');
1173
writeln(space,' Index: ',getlongint);
1174
writeln(space,' Default: ',getlongint);
1175
write (space,' Index Type: ');
1177
write (space,' Readaccess: ');
1178
readsymlist(space+' Sym: ');
1179
write (space,' Writeaccess: ');
1180
readsymlist(space+' Sym: ');
1181
write (space,'Storedaccess: ');
1339
write (space,' Prop Type : ');
1341
writeln(space,' Index : ',getlongint);
1342
writeln(space,' Default : ',getlongint);
1343
write (space,' Index Type : ');
1345
write (space,' Readaccess : ');
1346
readsymlist(space+' Sym: ');
1347
write (space,' Writeaccess : ');
1348
readsymlist(space+' Sym: ');
1349
write (space,' Storedaccess : ');
1182
1350
readsymlist(space+' Sym: ');
1951
2160
$Log: ppudump.pp,v $
1952
Revision 1.50 2003/12/16 21:29:25 florian
1953
+ inlined procedures inherit procinfo flags
1955
Revision 1.49 2003/12/08 21:04:08 peter
1956
* line break in uses unit
1958
Revision 1.48 2003/11/10 22:02:52 peter
1959
* cross unit inlining fixed
1961
Revision 1.47 2003/10/22 20:40:00 peter
1962
* write derefdata in a separate ppu entry
1964
Revision 1.46 2003/07/02 22:18:04 peter
1965
* paraloc splitted in callerparaloc,calleeparaloc
1966
* sparc calling convention updates
1968
Revision 1.45 2003/06/25 18:31:23 peter
1969
* sym,def resolving partly rewritten to support also parent objects
1970
not directly available through the uses clause
1972
Revision 1.44 2003/06/09 12:59:00 peter
1973
* updated for new deref info
1975
Revision 1.43 2003/06/05 20:06:11 peter
1978
Revision 1.42 2003/05/09 17:47:03 peter
1979
* self moved to hidden parameter
1980
* removed hdisposen,hnewn,selfn
1982
Revision 1.41 2003/04/27 07:29:52 peter
1983
* aktprocdef cleanup, aktprocdef is now always nil when parsing
1984
a new procdef declaration
1985
* aktprocsym removed
1986
* lexlevel removed, use symtable.symtablelevel instead
1987
* implicit init/final code uses the normal genentry/genexit
1988
* funcret state checking updated for new funcret handling
1990
Revision 1.39 2003/04/25 20:59:35 peter
1991
* removed funcretn,funcretsym, function result is now in varsym
1992
and aliases for result and function name are added using absolutesym
1993
* vs_hidden parameter for funcret passed in parameter
1995
* writenode changed to printnode and released from extdebug
1996
* -vp option added to generate a tree.log with the nodetree
1997
* nicer printnode for statements, callnode
1999
Revision 1.38 2003/04/10 17:57:53 peter
2000
* vs_hidden released
2002
Revision 1.37 2003/03/24 19:57:54 hajny
2005
Revision 1.36 2003/03/17 15:54:22 peter
2006
* store symoptions also for procdef
2007
* check symoptions (private,public) when calculating possible
2010
Revision 1.35 2003/01/03 22:16:29 peter
2011
* updated for absolutesym and varsym
2013
Revision 1.34 2002/11/17 16:32:04 carl
2014
* memory optimization (3-4%) : cleanup of tai fields,
2015
cleanup of tdef and tsym fields.
2016
* make it work for m68k
2018
Revision 1.33 2002/10/20 14:49:31 peter
2019
* store original source time in ppu so it can be compared instead of
2020
comparing with the ppu time
2022
Revision 1.32 2002/10/06 12:25:53 florian
2023
+ dump of tdefoptions.df_unique
2025
Revision 1.31 2002/09/27 21:22:04 carl
2026
* update system information
2028
Revision 1.30 2002/09/26 12:03:54 florian
2029
+ support of constguid and constwchar const symbols added
2031
Revision 1.29 2002/08/20 16:54:40 peter
2032
* write address of varsym always
2034
Revision 1.28 2002/08/19 19:36:44 peter
2035
* More fixes for cross unit inlining, all tnodes are now implemented
2036
* Moved pocall_internconst to po_internconst because it is not a
2037
calling type at all and it conflicted when inlining of these small
2038
functions was requested
2040
Revision 1.27 2002/08/15 15:15:56 carl
2041
* jmpbuf size allocation for exceptions is now cpu specific (as it should)
2042
* more generic nodes for maths
2043
* several fixes for better m68k support
2045
Revision 1.26 2002/08/11 13:24:20 peter
2046
* saving of asmsymbols in ppu supported
2047
* asmsymbollist global is removed and moved into a new class
2048
tasmlibrarydata that will hold the info of a .a file which
2049
corresponds with a single module. Added librarydata to tmodule
2050
to keep the library info stored for the module. In the future the
2051
objectfiles will also be stored to the tasmlibrarydata class
2052
* all getlabel/newasmsymbol and friends are moved to the new class
2054
Revision 1.25 2002/05/18 13:34:27 peter
2055
* readded missing revisions
2057
Revision 1.24 2002/05/16 19:46:54 carl
2058
+ defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
2059
+ try to fix temp allocation (still in ifdef)
2060
+ generic constructor calls
2061
+ start of tassembler / tmodulebase class cleanup
2063
Revision 1.22 2002/05/12 16:53:18 peter
2064
* moved entry and exitcode to ncgutil and cgobj
2065
* foreach gets extra argument for passing local data to the
2067
* -CR checks also class typecasts at runtime by changing them
2069
* fixed compiler to cycle with the -CR option
2070
* fixed stabs with elf writer, finally the global variables can
2072
* removed a lot of routines from cga unit and replaced them by
2074
* u32bit-s32bit updates for and,or,xor nodes. When one element is
2075
u32bit then the other is typecasted also to u32bit without giving
2076
a rangecheck warning/error.
2077
* fixed pascal calling method with reversing also the high tree in
2078
the parast, detected by tcalcst3 test
2080
Revision 1.21 2002/04/23 13:12:58 peter
2081
* updated for posinfo change
2082
* updated for mangledname change
2083
* include i386 registers, removed reference to cpubase unit that would
2084
make ppudump dependent on the source processor
2086
Revision 1.20 2002/04/15 19:15:09 carl
2087
+ write std_reg2str instead of gas registers
2089
Revision 1.19 2002/04/14 17:02:19 carl
2090
+ att_reg2str -> gas_reg2str
2092
Revision 1.18 2002/04/07 10:23:36 carl
2093
+ added vm / sparc targets
2095
Revision 1.17 2002/04/04 19:06:14 peter
2096
* removed unused units
2097
* use tlocation.size in cg.a_*loc*() routines
2099
Revision 1.16 2002/04/04 18:50:27 carl
2100
+ added wdosx support (patch from Pavel)
2102
Revision 1.15 2002/03/31 20:26:42 jonas
2103
+ a_loadfpu_* and a_loadmm_* methods in tcg
2104
* register allocation is now handled by a class and is mostly processor
2105
independent (+rgobj.pas and i386/rgcpu.pas)
2106
* temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
2107
* some small improvements and fixes to the optimizer
2108
* some register allocation fixes
2109
* some fpuvaroffset fixes in the unary minus node
2110
* push/popusedregisters is now called rg.save/restoreusedregisters and
2111
(for i386) uses temps instead of push/pop's when using -Op3 (that code is
2112
also better optimizable)
2113
* fixed and optimized register saving/restoring for new/dispose nodes
2114
* LOC_FPU locations now also require their "register" field to be set to
2115
R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
2116
- list field removed of the tnode class because it's not used currently
2117
and can cause hard-to-find bugs
2119
Revision 1.14 2002/03/28 20:48:52 carl
2120
- remove go32v1 support
2122
Revision 1.13 2002/03/28 16:44:59 armin
2123
+ new flag if unit has local threadvars
2125
Revision 1.12 2002/03/01 14:08:47 peter
2128
Revision 1.11 2002/01/06 12:08:16 peter
2129
* removed uauto from orddef, use new range_to_basetype generating
2130
the correct ordinal type for a range
2161
Revision 1.69 2005/04/24 20:00:57 florian
2162
+ more module flags added
2164
Revision 1.68 2005/03/27 14:10:53 jonas
2165
* const record parameters > 8 bytes are now passed by reference for non
2166
cdecl/cppdecl procedures on Mac OS/Mac OS X to fix compatibility with
2167
GPC (slightly more efficient than Metrowerks behaviour below, but
2168
less efficient in most cases than our previous scheme)
2169
+ "mwpascal" procedure directive to support the const record parameter
2170
behaviour of Metrowerks Pascal, which passes all const records by
2173
Revision 1.67 2005/03/07 18:38:46 peter
2174
* explicit paraloc for funcret
2175
* libsym for powerpc ppu's
2177
Revision 1.66 2005/02/14 17:13:10 peter
2180
Revision 1.65 2005/01/19 22:19:41 peter
2181
* unit mapping rewrite
2182
* new derefmap added
2184
Revision 1.64 2005/01/09 20:24:43 olle
2185
* rework of macro subsystem
2186
+ exportable macros for mode macpas