Browse Source

* 0.99.13
* new link support

peter 26 years ago
parent
commit
4f250dad55
2 changed files with 112 additions and 51 deletions
  1. 50 37
      utils/ppu.pas
  2. 62 14
      utils/ppudump.pp

+ 50 - 37
utils/ppu.pas

@@ -37,11 +37,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-{$ifdef OLDPPU}
-  CurrentPPUVersion=15;
-{$else}
   CurrentPPUVersion=16;
-{$endif}
 
 { buffer sizes }
   maxentrysize = 1024;
@@ -65,19 +61,21 @@ const
   ibendbrowser        = 254;
   ibend               = 255;
   {general}
-  ibmodulename     = 1;
-  ibsourcefiles    = 2;
-  ibloadunit       = 3;
-  ibinitunit       = 5;
-  iblinkofiles     = 6;
-  iblinksharedlibs = 7;
-  iblinkstaticlibs = 8;
-  ibdbxcount       = 9;
-  ibsymref         = 10;
-  ibdefref         = 11;
-  ibendsymtablebrowser   = 12;
-  ibbeginsymtablebrowser = 13;
-  iblinkunitfiles  = 14;
+  ibmodulename           = 1;
+  ibsourcefiles          = 2;
+  ibloadunit             = 3;
+  ibinitunit             = 4;
+  iblinkunitofiles       = 5;
+  iblinkunitstaticlibs   = 6;
+  iblinkunitsharedlibs   = 7;
+  iblinkotherofiles      = 8;
+  iblinkotherstaticlibs  = 9;
+  iblinkothersharedlibs  = 10;
+  ibdbxcount             = 11;
+  ibsymref               = 12;
+  ibdefref               = 13;
+  ibendsymtablebrowser   = 14;
+  ibbeginsymtablebrowser = 15;
   {syms}
   ibtypesym       = 20;
   ibprocsym       = 21;
@@ -117,12 +115,11 @@ const
   uf_big_endian    = $4;
   uf_has_dbx       = $8;
   uf_has_browser   = $10;
-  uf_smartlink     = $20;  { the ppu is smartlinked }
-  uf_in_library    = $40;  { is the file in another file than <ppufile>.* ? }
-  uf_static_linked = $80;  { the ppu is linked in a static library }
-  uf_shared_linked = $100; { the ppu is linked in a shared library }
+  uf_in_library    = $20;  { is the file in another file than <ppufile>.* ? }
+  uf_smart_linked  = $40;  { the ppu can be smartlinked }
+  uf_static_linked = $80;  { the ppu can be linked static }
+  uf_shared_linked = $100; { the ppu can be linked shared }
   uf_local_browser = $200;
-  uf_obj_linked    = $400; { the ppu is linked in a object file }
 
 type
 {$ifdef m68k}
@@ -142,10 +139,8 @@ type
     flags    : longint;
     size     : longint; { size of the ppufile without header }
     checksum : longint; { checksum for this ppufile }
-{$ifndef OLDPPU}
     interface_checksum : longint;
     future   : array[0..2] of longint;
-{$endif}
   end;
 
   tppuentry=packed record
@@ -235,11 +230,19 @@ implementation
 *****************************************************************************}
 
 var
+{$ifdef Delphi}
+  Crc32Tbl : array[0..255] of longword;
+{$else Delphi}
   Crc32Tbl : array[0..255] of longint;
+{$endif Delphi}
 
 procedure MakeCRC32Tbl;
 var
+{$ifdef Delphi}
+  crc : longword;
+{$else Delphi}
   crc : longint;
+{$endif Delphi}
   i,n : byte;
 begin
   for i:=0 to 255 do
@@ -360,7 +363,8 @@ end;
 function tppufile.GetPPUVersion:longint;
 var
   l    : longint;
-  code : word;
+  code : integer;
+
 begin
   Val(header.ver[1]+header.ver[2]+header.ver[3],l,code);
   if code=0 then
@@ -380,11 +384,7 @@ begin
      Id[3]:='U';
      Ver[1]:='0';
      Ver[2]:='1';
-{$ifdef OLDPPU}
-     Ver[3]:='5';
-{$else}
      Ver[3]:='6';
-{$endif}
    end;
 end;
 
@@ -396,7 +396,12 @@ end;
 function tppufile.open:boolean;
 var
   ofmode : byte;
+{$ifdef delphi}
+  i      : integer;
+{$else delphi}
   i      : word;
+{$endif delphi}
+
 begin
   open:=false;
   assign(f,fname);
@@ -792,7 +797,6 @@ begin
   if do_crc then
    begin
      crc:=UpdateCrc32(crc,b,len);
-{$ifndef OLDPPU}
      if do_interface_crc then
        begin
          interface_crc:=UpdateCrc32(interface_crc,b,len);
@@ -820,9 +824,6 @@ begin
        end;
     end;
   if not crc_only then
-{$else}
-    end;
-{$endif OLDPPU}
     writedata(b,len);
   inc(entryidx,len);
 end;
@@ -868,11 +869,23 @@ end;
 end.
 {
   $Log$
-  Revision 1.1  1999-05-12 16:11:39  peter
-    * moved
+  Revision 1.2  1999-07-03 00:25:43  peter
+    * 0.99.13
+    * new link support
+
+  Revision 1.33  1999/05/13 21:59:36  peter
+    * removed oldppu code
+    * warning if objpas is loaded from uses
+    * first things for new deref writing
+
+  Revision 1.32  1999/05/05 09:19:15  florian
+    * more fixes to get it with delphi running
+
+  Revision 1.31  1999/05/04 21:44:59  florian
+    * changes to compile it with Delphi 4.0
 
-  Revision 1.7  1999/04/26 18:27:38  peter
-    * more updates
+  Revision 1.30  1999/04/26 18:30:00  peter
+    * farpointerdef moved into pointerdef.is_far
 
   Revision 1.29  1999/04/26 13:31:41  peter
     * release storenumber,double_checksum

+ 62 - 14
utils/ppudump.pp

@@ -26,7 +26,7 @@ program pppdump;
 uses ppu;
 
 const
-  Version   = 'Version 0.99.12';
+  Version   = 'Version 0.99.13';
   Title     = 'PPU-Analyser';
   Copyright = 'Copyright (c) 1995-99 by the Free Pascal Development Team';
 
@@ -109,6 +109,46 @@ end;
                              Read Routines
 ****************************************************************************}
 
+Procedure ReadLinkContainer(const prefix:string);
+{
+  Read a serie of strings and write to the screen starting every line
+  with prefix
+}
+  function maskstr(m:longint):string;
+  const
+    { link options }
+    link_none    = $0;
+    link_allways = $1;
+    link_static  = $2;
+    link_smart   = $4;
+    link_shared  = $8;
+  var
+    s : string;
+  begin
+    s:='';
+    if (m and link_allways)<>0 then
+     s:=s+'always ';
+    if (m and link_static)<>0 then
+     s:=s+'static ';
+    if (m and link_smart)<>0 then
+     s:=s+'smart ';
+    if (m and link_shared)<>0 then
+     s:=s+'shared ';
+    maskstr:=s;
+  end;
+
+var
+  s : string;
+  m : longint;
+begin
+  while not ppufile^.endofentry do
+   begin
+     s:=ppufile^.getstring;
+     m:=ppufile^.getlongint;
+     WriteLn(prefix,s,' (',maskstr(m),')');
+   end;
+end;
+
 Procedure ReadContainer(const prefix:string);
 {
   Read a serie of strings and write to the screen starting every line
@@ -806,17 +846,23 @@ begin
               end;
            end;
 
-         iblinkofiles :
-           ReadContainer('Link object file: ');
+         iblinkunitofiles :
+           ReadLinkContainer('Link unit object file: ');
+
+         iblinkunitstaticlibs :
+           ReadLinkContainer('Link unit static lib: ');
 
-         iblinkstaticlibs :
-           ReadContainer('Link static lib: ');
+         iblinkunitsharedlibs :
+           ReadLinkContainer('Link unit shared lib: ');
 
-         iblinksharedlibs :
-           ReadContainer('Link shared lib: ');
+         iblinkotherofiles :
+           ReadLinkContainer('Link other object file: ');
 
-         iblinkunitfiles :
-           ReadContainer('Link unit file: ');
+         iblinkotherstaticlibs :
+           ReadLinkContainer('Link other static lib: ');
+
+         iblinkothersharedlibs :
+           ReadLinkContainer('Link other shared lib: ');
 
          iberror :
            begin
@@ -986,18 +1032,16 @@ begin
            write('has_dbx ');
           if (flags and uf_has_browser)<>0 then
            write('has_browser ');
-          if (flags and uf_smartlink)<>0 then
-           write('smartlink ');
           if (flags and uf_in_library)<>0 then
            write('in_library ');
+          if (flags and uf_smart_linked)<>0 then
+           write('smart_linked ');
           if (flags and uf_shared_linked)<>0 then
            write('shared_linked ');
           if (flags and uf_static_linked)<>0 then
            write('static_linked ');
           if (flags and uf_local_browser)<>0 then
            write('local_browser ');
-          if (flags and uf_obj_linked)<>0 then
-           write('obj_linked ');
           if (flags=0) then
            write('(none)');
           writeln;
@@ -1181,7 +1225,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.3  1999-06-08 22:16:06  peter
+  Revision 1.4  1999-07-03 00:25:44  peter
+    * 0.99.13
+    * new link support
+
+  Revision 1.3  1999/06/08 22:16:06  peter
     * version 0.99.12
 
   Revision 1.2  1999/05/14 17:52:04  peter