Преглед на файлове

o adapted to current ppu format:
* support enumsyms stored as part of the enumdef (r15051)
* removed po_local and added po_delphi_nested_cc (r15694)
* renamed pi_has_goto to pi_has_label (r15712)

git-svn-id: trunk@15798 -

Jonas Maebe преди 15 години
родител
ревизия
eb2581946c
променени са 1 файла, в които са добавени 48 реда и са изтрити 28 реда
  1. 48 28
      compiler/utils/ppudump.pp

+ 48 - 28
compiler/utils/ppudump.pp

@@ -70,7 +70,7 @@ type
     { set if the procedure has to push parameters onto the stack }
     pi_has_stackparameter,
     { set if the procedure has at least one got }
-    pi_has_goto,
+    pi_has_label,
     { calls itself recursive }
     pi_is_recursive,
     { stack frame optimization not possible (only on x86 probably) }
@@ -849,7 +849,7 @@ var
   { needed during tobjectdef parsing... }
   current_defoptions : tdefoptions;
 
-procedure readcommondef(const s:string);
+procedure readcommondef(const s:string; out defoptions: tdefoptions);
 type
   tdefstate=(ds_none,
     ds_vmt_written,
@@ -886,7 +886,6 @@ const
      (mask:ds_dwarf_dbg_info_written;str:'Dwarf DbgInfo Written')
   );
 var
-  defoptions : tdefoptions;
   defstates  : tdefstates;
   i      : longint;
   first  : boolean;
@@ -1139,7 +1138,6 @@ type
     po_syscall_basesysv,
     po_syscall_sysvbase,
     po_syscall_r12base,
-    po_local,
     { Procedure can be inlined }
     po_inline,
     { Procedure is used for internal compiler calls }
@@ -1156,7 +1154,15 @@ type
     { enumerator support }
     po_enumerator_movenext,
     { optional Objective-C protocol method }
-    po_optional
+    po_optional,
+    { nested procedure that uses Delphi-style calling convention for passing
+      the frame pointer (pushed on the stack, always the last parameter,
+      removed by the caller). Required for nested procvar compatibility,
+      because such procvars can hold both regular and nested procedures
+      (when calling a regular procedure using the above convention, it will
+       simply not see the frame pointer parameter, and since the caller cleans
+       up the stack will also remain balanced) }
+    po_delphi_nested_cc
   );
   tprocoptions=set of tprocoption;
 
@@ -1235,7 +1241,6 @@ const
      (mask:po_syscall_basesysv;str:'SyscallBaseSysV'),
      (mask:po_syscall_sysvbase;str:'SyscallSysVBase'),
      (mask:po_syscall_r12base; str:'SyscallR12Base'),
-     (mask:po_local;           str:'Local'),
      (mask:po_inline;          str:'Inline'),
      (mask:po_compilerproc;    str:'CompilerProc'),
      (mask:po_has_importdll;   str:'HasImportDLL'),
@@ -1245,7 +1250,8 @@ const
      (mask:po_weakexternal;    str:'WeakExternal'),
      (mask:po_objc;            str:'ObjC'),
      (mask:po_enumerator_movenext; str:'EnumeratorMoveNext'),
-     (mask:po_optional;        str: 'Optional')
+     (mask:po_optional;        str: 'Optional'),
+     (mask:po_delphi_nested_cc;str: 'Delphi-style nested frameptr')
   );
 var
   proctypeoption  : tproctypeoption;
@@ -1844,6 +1850,8 @@ begin
              writeln(space,'      Default : ',getlongint);
              write  (space,'   Index Type : ');
              readderef('');
+             { palt_none }
+             readpropaccesslist('');
              write  (space,'   Readaccess : ');
              readpropaccesslist(space+'         Sym: ');
              write  (space,'  Writeaccess : ');
@@ -1905,6 +1913,7 @@ var
   calloption : tproccalloption;
   procoptions : tprocoptions;
   procinfooptions : tprocinfoflag;
+  defoptions: tdefoptions;
 begin
   with ppufile do
    begin
@@ -1918,7 +1927,7 @@ begin
 
          ibpointerdef :
            begin
-             readcommondef('Pointer definition');
+             readcommondef('Pointer definition',defoptions);
              write  (space,'     Pointed Type : ');
              readderef('');
              writeln(space,'           Is Far : ',(getbyte<>0));
@@ -1926,7 +1935,7 @@ begin
 
          iborddef :
            begin
-             readcommondef('Ordinal definition');
+             readcommondef('Ordinal definition',defoptions);
              write  (space,'        Base type : ');
              b:=getbyte;
              case tordtype(b) of
@@ -1953,13 +1962,13 @@ begin
 
          ibfloatdef :
            begin
-             readcommondef('Float definition');
+             readcommondef('Float definition',defoptions);
              writeln(space,'       Float type : ',getbyte);
            end;
 
          ibarraydef :
            begin
-             readcommondef('Array definition');
+             readcommondef('Array definition',defoptions);
              write  (space,'     Element type : ');
              readderef('');
              write  (space,'       Range Type : ');
@@ -1971,7 +1980,7 @@ begin
 
          ibprocdef :
            begin
-             readcommondef('Procedure definition');
+             readcommondef('Procedure definition',defoptions);
              read_abstract_proc_def(calloption,procoptions);
              if (po_has_mangledname in procoptions) then
                writeln(space,'     Mangled name : ',getstring);
@@ -2041,8 +2050,9 @@ begin
 
          ibprocvardef :
            begin
-             readcommondef('Procedural type (ProcVar) definition');
+             readcommondef('Procedural type (ProcVar) definition',defoptions);
              read_abstract_proc_def(calloption,procoptions);
+             writeln(space,'   Symtable level :',ppufile.getbyte);
              if not EndOfEntry then
               Writeln('!! Entry has more information stored');
              space:='    '+space;
@@ -2054,31 +2064,31 @@ begin
 
          ibshortstringdef :
            begin
-             readcommondef('ShortString definition');
+             readcommondef('ShortString definition',defoptions);
              writeln(space,'           Length : ',getbyte);
            end;
 
          ibwidestringdef :
            begin
-             readcommondef('WideString definition');
+             readcommondef('WideString definition',defoptions);
              writeln(space,'           Length : ',getlongint);
            end;
 
          ibansistringdef :
            begin
-             readcommondef('AnsiString definition');
+             readcommondef('AnsiString definition',defoptions);
              writeln(space,'           Length : ',getlongint);
            end;
 
          iblongstringdef :
            begin
-             readcommondef('Longstring definition');
+             readcommondef('Longstring definition',defoptions);
              writeln(space,'           Length : ',getlongint);
            end;
 
          ibrecorddef :
            begin
-             readcommondef('Record definition');
+             readcommondef('Record definition',defoptions);
              writeln(space,'       FieldAlign : ',getbyte);
              writeln(space,'      RecordAlign : ',getbyte);
              writeln(space,'         PadAlign : ',getbyte);
@@ -2095,7 +2105,7 @@ begin
 
          ibobjectdef :
            begin
-             readcommondef('Object/Class definition');
+             readcommondef('Object/Class definition',defoptions);
              b:=getbyte;
              write  (space,'             Type : ');
              case tobjecttyp(b) of
@@ -2171,7 +2181,7 @@ begin
 
          ibfiledef :
            begin
-             ReadCommonDef('File definition');
+             ReadCommonDef('File definition',defoptions);
              write  (space,'             Type : ');
              case getbyte of
               0 : writeln('Text');
@@ -2186,33 +2196,43 @@ begin
 
          ibformaldef :
            begin
-             readcommondef('Generic definition (void-typ)');
+             readcommondef('Generic definition (void-typ)',defoptions);
              writeln(space,'         Is Typed : ',(getbyte<>0));
            end;
 
          ibundefineddef :
-           readcommondef('Undefined definition (generic parameter)');
+           readcommondef('Undefined definition (generic parameter)',defoptions);
 
          ibenumdef :
            begin
-             readcommondef('Enumeration type definition');
-             write(space,'Base enumeration type : ');
-             readderef('');
+             readcommondef('Enumeration type definition',defoptions);
              writeln(space,' Smallest element : ',getaint);
              writeln(space,'  Largest element : ',getaint);
              writeln(space,'             Size : ',getaint);
+             if df_copied_def in defoptions then
+               begin
+                 write(space,'Base enumeration type : ');
+                 readderef('');
+               end
+             else
+               begin
+                 space:='    '+space;
+                 readdefinitions('elements');
+                 readsymbols('elements');
+                 delete(space,1,4);
+               end;
            end;
 
          ibclassrefdef :
            begin
-             readcommondef('Class reference definition');
+             readcommondef('Class reference definition',defoptions);
              write  (space,'    Pointed Type : ');
              readderef('');
            end;
 
          ibsetdef :
            begin
-             readcommondef('Set definition');
+             readcommondef('Set definition',defoptions);
              write  (space,'     Element type : ');
              readderef('');
              writeln(space,'             Size : ',getaint);
@@ -2222,7 +2242,7 @@ begin
 
          ibvariantdef :
            begin
-             readcommondef('Variant definition');
+             readcommondef('Variant definition',defoptions);
              write  (space,'      Varianttype : ');
              b:=getbyte;
              case tvarianttype(b) of