Browse Source

* ppudump: Output "Size" attribute for objects and records.

git-svn-id: trunk@24506 -
yury 12 years ago
parent
commit
2ec85e9705
2 changed files with 11 additions and 7 deletions
  1. 9 7
      compiler/utils/ppuutils/ppudump.pp
  2. 2 0
      compiler/utils/ppuutils/ppuout.pp

+ 9 - 7
compiler/utils/ppuutils/ppudump.pp

@@ -2878,18 +2878,18 @@ begin
 
          ibrecorddef :
            begin
-             def:=TPpuRecordDef.Create(ParentDef);
-             readcommondef('Record definition',defoptions, def);
+             objdef:=TPpuRecordDef.Create(ParentDef);
+             readcommondef('Record definition',defoptions, objdef);
              def.Name:=getstring;
-             writeln([space,'   Name of Record : ',def.Name]);
+             writeln([space,'   Name of Record : ',objdef.Name]);
              writeln([space,'   Import lib/pkg : ',getstring]);
              write  ([space,'          Options : ']);
-             readobjectdefoptions(TPpuRecordDef(def));
+             readobjectdefoptions(objdef);
              if (df_copied_def in defoptions) then
                begin
                  Include(TPpuRecordDef(def).Options, ooCopied);
                  write([space,'      Copied from : ']);
-                 readderef('',TPpuRecordDef(def).Ancestor);
+                 readderef('',objdef.Ancestor);
                end
              else
                begin
@@ -2897,7 +2897,8 @@ begin
                  writeln([space,'      RecordAlign : ',shortint(getbyte)]);
                  writeln([space,'         PadAlign : ',shortint(getbyte)]);
                  writeln([space,'UseFieldAlignment : ',shortint(getbyte)]);
-                 writeln([space,'         DataSize : ',getasizeint]);
+                 objdef.Size:=getasizeint;
+                 writeln([space,'         DataSize : ',objdef.Size]);
                  writeln([space,'      PaddingSize : ',getword]);
                end;
              if not EndOfEntry then
@@ -2949,7 +2950,8 @@ begin
                  objdef.ObjType:=otHelper;
              end;
              writeln([space,'    External name : ',getstring]);
-             writeln([space,'         DataSize : ',getasizeint]);
+             objdef.Size:=getasizeint;
+             writeln([space,'         DataSize : ',objdef.Size]);
              writeln([space,'      PaddingSize : ',getword]);
              writeln([space,'       FieldAlign : ',shortint(getbyte)]);
              writeln([space,'      RecordAlign : ',shortint(getbyte)]);

+ 2 - 0
compiler/utils/ppuutils/ppuout.pp

@@ -267,6 +267,7 @@ type
     Options: TPpuObjOptions;
     IID: string;
     HelperParent: TPpuRef;
+    Size: integer;
     constructor Create(AParent: TPpuContainerDef); override;
     destructor Destroy; override;
     function CanWrite: boolean; override;
@@ -942,6 +943,7 @@ begin
         Output.WriteStr('', ObjOptionNames[opt]);
     Output.WriteArrayEnd('Options');
   end;
+  Output.WriteInt('Size', Size);
   if IID <> '' then
     Output.WriteStr('IID', IID);
   if not HelperParent.IsNull then