Browse Source

* win32 compilation error fix
+ some work for local browser (not cl=omplete yet)

pierre 26 years ago
parent
commit
2541a27a5a
4 changed files with 107 additions and 29 deletions
  1. 7 15
      compiler/pmodules.pas
  2. 80 6
      compiler/symdef.inc
  3. 11 3
      compiler/symppu.inc
  4. 9 5
      compiler/symsym.inc

+ 7 - 15
compiler/pmodules.pas

@@ -319,13 +319,6 @@ unit pmodules;
         { load browser info if stored }
         if ((current_module^.flags and uf_has_browser)<>0) then
           punitsymtable(current_module^.globalsymtable)^.load_symtable_refs;
-        if ((current_module^.flags and uf_local_browser)<>0) then
-         begin
-           current_module^.localsymtable:=new(psymtable,loadas(staticsymtable));
-           psymtable(current_module^.localsymtable)^.name:=
-              stringdup('implementation of '+psymtable(current_module^.globalsymtable)^.name^);
-           psymtable(current_module^.localsymtable)^.load_browser;
-         end;
         { remove the map, it's not needed anymore }
         dispose(current_module^.map);
         current_module^.map:=nil;
@@ -1055,17 +1048,12 @@ unit pmodules;
          if is_assembler_generated then
            insertobjectfile;
 
+         if cs_local_browser in aktmoduleswitches then
+           current_module^.localsymtable:=refsymtable;
          { Write out the ppufile }
          if (status.errorcount=0) then
            writeunitas(current_module^.ppufilename^,punitsymtable(symtablestack));
 
-         { write local browser }
-         if cs_local_browser in aktmoduleswitches then
-          begin
-            current_module^.localsymtable:=refsymtable;
-            refsymtable^.write;
-            refsymtable^.write_browser;
-          end;
           { must be done only after local symtable ref stores !! }
           closecurrentppu;
 {$ifdef GDB}
@@ -1259,7 +1247,11 @@ unit pmodules;
 end.
 {
   $Log$
-  Revision 1.99  1999-02-22 13:06:58  pierre
+  Revision 1.100  1999-02-23 18:29:20  pierre
+    * win32 compilation error fix
+    + some work for local browser (not cl=omplete yet)
+
+  Revision 1.99  1999/02/22 13:06:58  pierre
     + -b and -bl options work !
     + cs_local_browser ($L+) is disabled if cs_browser ($Y+)
       is not enabled when quitting global section

+ 80 - 6
compiler/symdef.inc

@@ -2229,9 +2229,14 @@
       end;
 
 
+Const local_symtable_index : longint = $8001;
+
     procedure tprocdef.load_references;
       var
         pos : tfileposinfo;
+{$ifdef TESTLOCALBROWSER}
+        pdo : pobjectdef;
+{$endif def TESTLOCALBROWSER}
         move_last : boolean;
       begin
         move_last:=lastwritten=lastref;
@@ -2248,12 +2253,48 @@
           lastwritten:=lastref;
         if (current_module^.flags and uf_local_browser)<>0 then
           begin
-{$ifdef Dummy}
+{$ifdef TESTLOCALBROWSER}
+             pdo:=_class;
+             if assigned(pdo) and (owner^.symtabletype<>localsymtable) then
+               localsymtablestack:=pdo^.publicsyms;
+             if owner^.symtabletype<>localsymtable then
+               while assigned(pdo) do
+                 begin
+                    if pdo^.publicsyms<>aktrecordsymtable then
+                      begin
+                         pdo^.publicsyms^.unitid:=local_symtable_index;
+                         inc(local_symtable_index);
+                      end;
+                    pdo:=pdo^.childof;
+                 end;
+               
              new(parast,loadas(parasymtable));
+             parast^.next:=localsymtablestack;
+             localsymtablestack:=parast;
+             parast^.unitid:=local_symtable_index;
+             inc(local_symtable_index);
              parast^.load_browser;
              new(localst,loadas(localsymtable));
+             localst^.next:=localsymtablestack;
+             localsymtablestack:=localst;
+             localst^.unitid:=local_symtable_index;
+             inc(local_symtable_index);
              localst^.load_browser;
-{$endif def Dummy}
+             { decrement for }
+             local_symtable_index:=local_symtable_index-2;
+             localsymtablestack:=localsymtablestack^.next^.next;
+             pdo:=_class;
+             if (owner^.symtabletype<>localsymtable) then
+               localsymtablestack:=nil;
+             if (owner^.symtabletype<>localsymtable) then
+               while assigned(pdo) do
+                 begin
+                    if pdo^.publicsyms<>aktrecordsymtable then
+                      dec(local_symtable_index);
+                    pdo:=pdo^.childof;
+                 end;
+
+{$endif def TESTLOCALBROWSER}
           end;
       end;
 
@@ -2261,6 +2302,9 @@
     function tprocdef.write_references : boolean;
       var
         ref : pref;
+{$ifdef TESTLOCALBROWSER}
+        pdo : pobjectdef;
+{$endif def TESTLOCALBROWSER}
         move_last : boolean;
       begin
         move_last:=lastwritten=lastref;
@@ -2292,18 +2336,44 @@
         write_references:=true;
         if (current_module^.flags and uf_local_browser)<>0 then
           begin
-{$ifdef Dummy}
-             { we need dummy para and local symtables
+{$ifdef TESTLOCALBROWSER}
+             pdo:=_class;
+             if (owner^.symtabletype<>localsymtable) then
+               while assigned(pdo) do
+                 begin
+                    if pdo^.publicsyms<>aktrecordsymtable then
+                      begin
+                         pdo^.publicsyms^.unitid:=local_symtable_index;
+                         inc(local_symtable_index);
+                      end;
+                    pdo:=pdo^.childof;
+                 end;
+               
+             { we need TESTLOCALBROWSER para and local symtables
                PPU files are then easier to read PM }
              if not assigned(parast) then
                parast:=new(psymtable,init(parasymtable));
              parast^.writeas;
+             parast^.unitid:=local_symtable_index;
+             inc(local_symtable_index);
              parast^.write_browser;
              if not assigned(localst) then
                localst:=new(psymtable,init(localsymtable));
              localst^.writeas;
+             localst^.unitid:=local_symtable_index;
+             inc(local_symtable_index);
              localst^.write_browser;
-{$endif def Dummy}
+             { decrement for }
+             local_symtable_index:=local_symtable_index-2;
+             pdo:=_class;
+             if (owner^.symtabletype<>localsymtable) then
+               while assigned(pdo) do
+                 begin
+                    if pdo^.publicsyms<>aktrecordsymtable then
+                      dec(local_symtable_index);
+                    pdo:=pdo^.childof;
+                 end;
+{$endif def TESTLOCALBROWSER}
           end;
       end;
 
@@ -3308,7 +3378,11 @@
 
 {
   $Log$
-  Revision 1.94  1999-02-22 20:13:38  florian
+  Revision 1.95  1999-02-23 18:29:23  pierre
+    * win32 compilation error fix
+    + some work for local browser (not cl=omplete yet)
+
+  Revision 1.94  1999/02/22 20:13:38  florian
     + first implementation of message keyword
 
   Revision 1.93  1999/02/22 13:07:07  pierre

+ 11 - 3
compiler/symppu.inc

@@ -111,8 +111,10 @@
          begin
            if p^.owner^.symtabletype=staticsymtable then
             current_ppu^.putword($fffe)
-           else if not (p^.owner^.symtabletype in [unitsymtable,globalsymtable]) then
+           else if (p^.owner=aktrecordsymtable) then
             current_ppu^.putword($ffff)
+           else if p^.owner^.unitid>$8000 then
+            current_ppu^.putword(p^.owner^.unitid)
            else
             current_ppu^.putword(p^.owner^.unitid);
            current_ppu^.putword(p^.indexnb);
@@ -128,8 +130,10 @@
          begin
            if p^.owner^.symtabletype=staticsymtable then
             current_ppu^.putword($fffe)
-           else if not (p^.owner^.symtabletype in [unitsymtable,globalsymtable]) then
+           else if (p^.owner=aktrecordsymtable) then
             current_ppu^.putword($ffff)
+           else if p^.owner^.unitid>$8000 then
+            current_ppu^.putword(p^.owner^.unitid)
            else
             current_ppu^.putword(p^.owner^.unitid);
            current_ppu^.putword(p^.indexnb);
@@ -448,7 +452,11 @@
 
 {
   $Log$
-  Revision 1.32  1999-02-22 13:07:08  pierre
+  Revision 1.33  1999-02-23 18:29:25  pierre
+    * win32 compilation error fix
+    + some work for local browser (not cl=omplete yet)
+
+  Revision 1.32  1999/02/22 13:07:08  pierre
     + -b and -bl options work !
     + cs_local_browser ($L+) is disabled if cs_browser ($Y+)
       is not enabled when quitting global section

+ 9 - 5
compiler/symsym.inc

@@ -1704,9 +1704,9 @@
       begin
          inherited load_references;
          if (definition^.deftype=recorddef) then
-            precdef(definition)^.symtable^.load_browser;
+           precdef(definition)^.symtable^.load_browser;
          if (definition^.deftype=objectdef) then
-             pobjectdef(definition)^.publicsyms^.load_browser;
+           pobjectdef(definition)^.publicsyms^.load_browser;
       end;
 
 
@@ -1724,9 +1724,9 @@
           end;
          write_references:=true;
          if (definition^.deftype=recorddef) then
-            precdef(definition)^.symtable^.write_browser;
+           precdef(definition)^.symtable^.write_browser;
          if (definition^.deftype=objectdef) then
-             pobjectdef(definition)^.publicsyms^.write_browser;
+           pobjectdef(definition)^.publicsyms^.write_browser;
       end;
 
 
@@ -1811,7 +1811,11 @@
 
 {
   $Log$
-  Revision 1.73  1999-02-22 13:07:09  pierre
+  Revision 1.74  1999-02-23 18:29:27  pierre
+    * win32 compilation error fix
+    + some work for local browser (not cl=omplete yet)
+
+  Revision 1.73  1999/02/22 13:07:09  pierre
     + -b and -bl options work !
     + cs_local_browser ($L+) is disabled if cs_browser ($Y+)
       is not enabled when quitting global section