Răsfoiți Sursa

* local browsing works at first level
ie for function defined in interface or implementation
not yet for functions inside other functions

pierre 26 ani în urmă
părinte
comite
25553ebfea
4 a modificat fișierele cu 155 adăugiri și 59 ștergeri
  1. 20 5
      compiler/symdef.inc
  2. 15 1
      compiler/symppu.inc
  3. 6 3
      compiler/symsym.inc
  4. 114 50
      compiler/symtable.pas

+ 20 - 5
compiler/symdef.inc

@@ -217,7 +217,7 @@
                    is_in_current:=true;
                    is_in_current:=true;
                    exit;
                    exit;
                 end
                 end
-              else if p^.symtabletype=objectsymtable then
+              else if p^.symtabletype in [{localsymtable,parasymtable,}objectsymtable] then
                 begin
                 begin
                   if assigned(p^.defowner) then
                   if assigned(p^.defowner) then
                     p:=pobjectdef(p^.defowner)^.owner
                     p:=pobjectdef(p^.defowner)^.owner
@@ -381,8 +381,6 @@
       { to avoid infinite loops }
       { to avoid infinite loops }
       is_def_stab_written := true;
       is_def_stab_written := true;
       stab_str := allstabstring;
       stab_str := allstabstring;
-      if asmlist = debuglist then do_count_dbx := true;
-      { count_dbx(stab_str); moved to GDB.PAS}
       asmlist^.concat(new(pai_stabs,init(stab_str)));
       asmlist^.concat(new(pai_stabs,init(stab_str)));
       end;
       end;
     end;
     end;
@@ -1481,7 +1479,6 @@
                   end;
                   end;
                 st := '"'+st+':t'+numberstring+'=*'+definition^.numberstring
                 st := '"'+st+':t'+numberstring+'=*'+definition^.numberstring
                       +'=xs'+definition^.sym^.name+':",'+tostr(N_LSYM)+',0,'+tostr(sym_line_no)+',0';
                       +'=xs'+definition^.sym^.name+':",'+tostr(N_LSYM)+',0,'+tostr(sym_line_no)+',0';
-                if asmlist = debuglist then do_count_dbx := true;
                 asmlist^.concat(new(pai_stabs,init(strpnew(st))));
                 asmlist^.concat(new(pai_stabs,init(strpnew(st))));
                 end;
                 end;
               end else inherited concatstabto(asmlist);
               end else inherited concatstabto(asmlist);
@@ -2549,6 +2546,7 @@ Const local_symtable_index : longint = $8001;
         pos : tfileposinfo;
         pos : tfileposinfo;
 {$ifndef NOLOCALBROWSER}
 {$ifndef NOLOCALBROWSER}
         pdo : pobjectdef;
         pdo : pobjectdef;
+        st : psymtable;
 {$endif ndef NOLOCALBROWSER}
 {$endif ndef NOLOCALBROWSER}
         move_last : boolean;
         move_last : boolean;
       begin
       begin
@@ -2569,12 +2567,19 @@ Const local_symtable_index : longint = $8001;
           begin
           begin
 {$ifndef NOLOCALBROWSER}
 {$ifndef NOLOCALBROWSER}
              pdo:=_class;
              pdo:=_class;
+             st:=aktlocalsymtable;
              new(parast,loadas(parasymtable));
              new(parast,loadas(parasymtable));
+             aktlocalsymtable:=parast;
+             parast^.deref;
              parast^.next:=owner;
              parast^.next:=owner;
              parast^.load_browser;
              parast^.load_browser;
+             aktlocalsymtable:=st;
              new(localst,loadas(localsymtable));
              new(localst,loadas(localsymtable));
+             aktlocalsymtable:=localst;
+             localst^.deref;
              localst^.next:=parast;
              localst^.next:=parast;
              localst^.load_browser;
              localst^.load_browser;
+             aktlocalsymtable:=st;
 {$endif ndef NOLOCALBROWSER}
 {$endif ndef NOLOCALBROWSER}
           end;
           end;
       end;
       end;
@@ -2585,6 +2590,7 @@ Const local_symtable_index : longint = $8001;
         ref : pref;
         ref : pref;
 {$ifndef NOLOCALBROWSER}
 {$ifndef NOLOCALBROWSER}
         pdo : pobjectdef;
         pdo : pobjectdef;
+        st : psymtable;
 {$endif ndef NOLOCALBROWSER}
 {$endif ndef NOLOCALBROWSER}
         move_last : boolean;
         move_last : boolean;
       begin
       begin
@@ -2636,16 +2642,20 @@ Const local_symtable_index : longint = $8001;
                PPU files are then easier to read PM }
                PPU files are then easier to read PM }
              if not assigned(parast) then
              if not assigned(parast) then
                parast:=new(psymtable,init(parasymtable));
                parast:=new(psymtable,init(parasymtable));
+             st:=aktlocalsymtable;
+             aktlocalsymtable:=parast;
              parast^.writeas;
              parast^.writeas;
              parast^.unitid:=local_symtable_index;
              parast^.unitid:=local_symtable_index;
              inc(local_symtable_index);
              inc(local_symtable_index);
              parast^.write_browser;
              parast^.write_browser;
              if not assigned(localst) then
              if not assigned(localst) then
                localst:=new(psymtable,init(localsymtable));
                localst:=new(psymtable,init(localsymtable));
+             aktlocalsymtable:=localst;
              localst^.writeas;
              localst^.writeas;
              localst^.unitid:=local_symtable_index;
              localst^.unitid:=local_symtable_index;
              inc(local_symtable_index);
              inc(local_symtable_index);
              localst^.write_browser;
              localst^.write_browser;
+             aktlocalsymtable:=st;
              { decrement for }
              { decrement for }
              local_symtable_index:=local_symtable_index-2;
              local_symtable_index:=local_symtable_index-2;
              pdo:=_class;
              pdo:=_class;
@@ -3801,7 +3811,12 @@ Const local_symtable_index : longint = $8001;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.172  1999-10-26 12:30:45  peter
+  Revision 1.173  1999-11-05 17:18:02  pierre
+    * local browsing works at first level
+      ie for function defined in interface or implementation
+      not yet for functions inside other functions
+
+  Revision 1.172  1999/10/26 12:30:45  peter
     * const parameter is now checked
     * const parameter is now checked
     * better and generic check if a node can be used for assigning
     * better and generic check if a node can be used for assigning
     * export fixes
     * export fixes

+ 15 - 1
compiler/symppu.inc

@@ -111,6 +111,12 @@
               current_ppu^.putbyte(ord(derefaktrecordindex));
               current_ppu^.putbyte(ord(derefaktrecordindex));
               current_ppu^.putword(p^.indexnr);
               current_ppu^.putword(p^.indexnr);
             end
             end
+           { Local local/para symtable ? }
+           else if (p^.owner=aktlocalsymtable) then
+            begin
+              current_ppu^.putbyte(ord(derefaktlocal));
+              current_ppu^.putword(p^.indexnr);
+            end
            else
            else
             begin
             begin
               current_ppu^.putbyte(ord(derefindex));
               current_ppu^.putbyte(ord(derefindex));
@@ -466,6 +472,7 @@
               break;
               break;
             derefunit,
             derefunit,
             derefaktrecordindex,
             derefaktrecordindex,
+            derefaktlocal,
             derefaktstaticindex :
             derefaktstaticindex :
               begin
               begin
                 new(p,init(b,current_ppu^.getword));
                 new(p,init(b,current_ppu^.getword));
@@ -473,6 +480,8 @@
                 break;
                 break;
               end;
               end;
             derefindex,
             derefindex,
+            dereflocal,
+            derefpara,
             derefrecord :
             derefrecord :
               begin
               begin
                 new(p,init(b,current_ppu^.getword));
                 new(p,init(b,current_ppu^.getword));
@@ -747,7 +756,12 @@
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.51  1999-09-16 13:27:08  pierre
+  Revision 1.52  1999-11-05 17:18:03  pierre
+    * local browsing works at first level
+      ie for function defined in interface or implementation
+      not yet for functions inside other functions
+
+  Revision 1.51  1999/09/16 13:27:08  pierre
     + error if PPU modulename is different from what is searched
     + error if PPU modulename is different from what is searched
       (8+3 limitations!)
       (8+3 limitations!)
     + cond ORDERSOURCES to allow recompilation of FP
     + cond ORDERSOURCES to allow recompilation of FP

+ 6 - 3
compiler/symsym.inc

@@ -191,7 +191,6 @@
          if not isstabwritten then
          if not isstabwritten then
            begin
            begin
               stab_str := stabstring;
               stab_str := stabstring;
-              if asmlist = debuglist then do_count_dbx := true;
               { count_dbx(stab_str); moved to GDB.PAS }
               { count_dbx(stab_str); moved to GDB.PAS }
               asmlist^.concat(new(pai_stabs,init(stab_str)));
               asmlist^.concat(new(pai_stabs,init(stab_str)));
               isstabwritten:=true;
               isstabwritten:=true;
@@ -2140,7 +2139,12 @@
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.122  1999-10-21 16:41:41  florian
+  Revision 1.123  1999-11-05 17:18:03  pierre
+    * local browsing works at first level
+      ie for function defined in interface or implementation
+      not yet for functions inside other functions
+
+  Revision 1.122  1999/10/21 16:41:41  florian
     * problems with readln fixed: esi wasn't restored correctly when
     * problems with readln fixed: esi wasn't restored correctly when
       reading ordinal fields of objects futher the register allocation
       reading ordinal fields of objects futher the register allocation
       didn't take care of the extra register when reading ordinal values
       didn't take care of the extra register when reading ordinal values
@@ -2641,4 +2645,3 @@
     * symtable adapted for $ifndef OLDPPU
     * symtable adapted for $ifndef OLDPPU
 
 
 }
 }
-

+ 114 - 50
compiler/symtable.pas

@@ -83,7 +83,7 @@ unit symtable;
       { Deref entry options }
       { Deref entry options }
       tdereftype = (derefnil,derefaktrecordindex,derefaktstaticindex,
       tdereftype = (derefnil,derefaktrecordindex,derefaktstaticindex,
                     derefunit,derefrecord,derefindex,
                     derefunit,derefrecord,derefindex,
-                    dereflocal,derefpara);
+                    dereflocal,derefpara,derefaktlocal);
 
 
       pderef = ^tderef;
       pderef = ^tderef;
       tderef = object
       tderef = object
@@ -450,6 +450,7 @@ implementation
   var
   var
      aktrecordsymtable : psymtable; { current record read from ppu symtable }
      aktrecordsymtable : psymtable; { current record read from ppu symtable }
      aktstaticsymtable : psymtable; { current static for local ppu symtable }
      aktstaticsymtable : psymtable; { current static for local ppu symtable }
+     aktlocalsymtable  : psymtable; { current proc local for local ppu symtable }
 {$ifdef GDB}
 {$ifdef GDB}
      asmoutput : paasmoutput;
      asmoutput : paasmoutput;
 {$endif GDB}
 {$endif GDB}
@@ -729,6 +730,11 @@ implementation
                  st:=aktstaticsymtable;
                  st:=aktstaticsymtable;
                  idx:=p^.index;
                  idx:=p^.index;
                end;
                end;
+             derefaktlocal :
+               begin
+                 st:=aktlocalsymtable;
+                 idx:=p^.index;
+               end;
              derefunit :
              derefunit :
                begin
                begin
 {$ifdef NEWMAP}
 {$ifdef NEWMAP}
@@ -1318,10 +1324,16 @@ implementation
          new(symsearch,init);
          new(symsearch,init);
          symsearch^.noclear:=true;
          symsearch^.noclear:=true;
          defowner:=nil;
          defowner:=nil;
-         storesymtable:=aktrecordsymtable;
-         if typ in [recordsymtable,objectsymtable,
-                    parasymtable,localsymtable] then
-           aktrecordsymtable:=@self;
+         if typ in [recordsymtable,objectsymtable] then
+           begin
+             storesymtable:=aktrecordsymtable;
+             aktrecordsymtable:=@self;
+           end;
+         if typ in [parasymtable,localsymtable] then
+           begin
+             storesymtable:=aktlocalsymtable;
+             aktlocalsymtable:=@self;
+           end;
          { used for local browser }
          { used for local browser }
          if typ=staticppusymtable then
          if typ=staticppusymtable then
            begin
            begin
@@ -1338,7 +1350,7 @@ implementation
 
 
       { load definitions }
       { load definitions }
       { we need the correct symtable for registering }
       { we need the correct symtable for registering }
-         if not (typ in [recordsymtable,objectsymtable]) then
+         if not (typ in [localsymtable,parasymtable,recordsymtable,objectsymtable]) then
            begin
            begin
              next:=symtablestack;
              next:=symtablestack;
              symtablestack:=@self;
              symtablestack:=@self;
@@ -1351,11 +1363,15 @@ implementation
          loadsyms;
          loadsyms;
 
 
       { now we can deref the syms and defs }
       { now we can deref the syms and defs }
-         if not (typ in [recordsymtable,objectsymtable]) then
+         if not (typ in [localsymtable,parasymtable,
+                         recordsymtable,objectsymtable]) then
            deref;
            deref;
 
 
-         aktrecordsymtable:=storesymtable;
-         if not (typ in [recordsymtable,objectsymtable]) then
+         if typ in [recordsymtable,objectsymtable] then
+           aktrecordsymtable:=storesymtable;
+         if typ in [localsymtable,parasymtable] then
+           aktlocalsymtable:=storesymtable;
+         if not (typ in [localsymtable,parasymtable,recordsymtable,objectsymtable]) then
            begin
            begin
              symtablestack:=next;
              symtablestack:=next;
            end;
            end;
@@ -1370,9 +1386,16 @@ implementation
       begin
       begin
          oldtyp:=current_ppu^.entrytyp;
          oldtyp:=current_ppu^.entrytyp;
          storesymtable:=aktrecordsymtable;
          storesymtable:=aktrecordsymtable;
-         if symtabletype in [recordsymtable,objectsymtable,
-                    parasymtable,localsymtable] then
-           aktrecordsymtable:=@self;
+         if symtabletype in [recordsymtable,objectsymtable] then
+           begin
+             storesymtable:=aktrecordsymtable;
+             aktrecordsymtable:=@self;
+           end;
+         if symtabletype in [parasymtable,localsymtable] then
+           begin
+             storesymtable:=aktlocalsymtable;
+             aktlocalsymtable:=@self;
+           end;
          if (symtabletype in [recordsymtable,objectsymtable]) then
          if (symtabletype in [recordsymtable,objectsymtable]) then
          current_ppu^.entrytyp:=subentryid;
          current_ppu^.entrytyp:=subentryid;
          { write definitions }
          { write definitions }
@@ -1380,7 +1403,10 @@ implementation
          { write symbols }
          { write symbols }
          writesyms;
          writesyms;
          current_ppu^.entrytyp:=oldtyp;
          current_ppu^.entrytyp:=oldtyp;
-         aktrecordsymtable:=storesymtable;
+         if symtabletype in [recordsymtable,objectsymtable] then
+           aktrecordsymtable:=storesymtable;
+         if symtabletype in [localsymtable,parasymtable] then
+           aktlocalsymtable:=storesymtable;
       end;
       end;
 
 
 
 
@@ -1604,12 +1630,16 @@ implementation
         prdef : pdef;
         prdef : pdef;
         oldrecsyms : psymtable;
         oldrecsyms : psymtable;
       begin
       begin
-         if symtabletype in [recordsymtable,objectsymtable,
-                    parasymtable,localsymtable] then
+         if symtabletype in [recordsymtable,objectsymtable] then
            begin
            begin
               oldrecsyms:=aktrecordsymtable;
               oldrecsyms:=aktrecordsymtable;
               aktrecordsymtable:=@self;
               aktrecordsymtable:=@self;
            end;
            end;
+         if symtabletype in [parasymtable,localsymtable] then
+           begin
+              oldrecsyms:=aktlocalsymtable;
+              aktlocalsymtable:=@self;
+           end;
          if symtabletype=staticppusymtable then
          if symtabletype=staticppusymtable then
            aktstaticsymtable:=@self;
            aktstaticsymtable:=@self;
          b:=current_ppu^.readentry;
          b:=current_ppu^.readentry;
@@ -1639,9 +1669,10 @@ implementation
              Message1(unit_f_ppu_invalid_entry,tostr(b));
              Message1(unit_f_ppu_invalid_entry,tostr(b));
            end;
            end;
          until false;
          until false;
-         if symtabletype in [recordsymtable,objectsymtable,
-                    parasymtable,localsymtable] then
-           aktrecordsymtable:=oldrecsyms;
+        if symtabletype in [recordsymtable,objectsymtable] then
+          aktrecordsymtable:=oldrecsyms;
+        if symtabletype in [parasymtable,localsymtable] then
+          aktlocalsymtable:=oldrecsyms;
       end;
       end;
 
 
 
 
@@ -1654,18 +1685,23 @@ implementation
          number_symbols;
          number_symbols;
          number_defs;   }
          number_defs;   }
 
 
-         if symtabletype in [recordsymtable,objectsymtable,
-                    parasymtable,localsymtable] then
+         if symtabletype in [recordsymtable,objectsymtable] then
            begin
            begin
               oldrecsyms:=aktrecordsymtable;
               oldrecsyms:=aktrecordsymtable;
               aktrecordsymtable:=@self;
               aktrecordsymtable:=@self;
            end;
            end;
+         if symtabletype in [parasymtable,localsymtable] then
+           begin
+              oldrecsyms:=aktlocalsymtable;
+              aktlocalsymtable:=@self;
+           end;
          current_ppu^.writeentry(ibbeginsymtablebrowser);
          current_ppu^.writeentry(ibbeginsymtablebrowser);
          foreach({$ifndef TP}@{$endif}write_refs);
          foreach({$ifndef TP}@{$endif}write_refs);
          current_ppu^.writeentry(ibendsymtablebrowser);
          current_ppu^.writeentry(ibendsymtablebrowser);
-         if symtabletype in [recordsymtable,objectsymtable,
-                    parasymtable,localsymtable] then
-           aktrecordsymtable:=oldrecsyms;
+        if symtabletype in [recordsymtable,objectsymtable] then
+          aktrecordsymtable:=oldrecsyms;
+        if symtabletype in [parasymtable,localsymtable] then
+          aktlocalsymtable:=oldrecsyms;
       end;
       end;
 
 
 
 
@@ -1789,21 +1825,26 @@ implementation
          symsearch^.usehash;
          symsearch^.usehash;
        { reset GDB things }
        { reset GDB things }
 {$ifdef GDB}
 {$ifdef GDB}
-         if t = globalsymtable then
+         if (t = globalsymtable) then
            begin
            begin
               prev_dbx_counter := dbx_counter;
               prev_dbx_counter := dbx_counter;
-              dbx_counter := @dbx_count;
+              dbx_counter := nil;
            end;
            end;
          is_stab_written:=false;
          is_stab_written:=false;
+         dbx_count := -1;
          if cs_gdb_dbx in aktglobalswitches then
          if cs_gdb_dbx in aktglobalswitches then
            begin
            begin
              dbx_count := 0;
              dbx_count := 0;
+             unittypecount:=1;
              if (symtabletype=globalsymtable) then
              if (symtabletype=globalsymtable) then
                pglobaltypecount := @unittypecount;
                pglobaltypecount := @unittypecount;
-             debuglist^.concat(new(pai_stabs,init(strpnew('"'+name^+'",'+tostr(N_BINCL)+',0,0,0'))));
              unitid:=current_module^.unitcount;
              unitid:=current_module^.unitcount;
-             inc(current_module^.unitcount);
              debuglist^.concat(new(pai_asm_comment,init(strpnew('Global '+name^+' has index '+tostr(unitid)))));
              debuglist^.concat(new(pai_asm_comment,init(strpnew('Global '+name^+' has index '+tostr(unitid)))));
+             debuglist^.concat(new(pai_stabs,init(strpnew('"'+name^+'",'+tostr(N_BINCL)+',0,0,0'))));
+             inc(current_module^.unitcount);
+             dbx_count_ok:=false;
+             dbx_counter:=@dbx_count;
+             do_count_dbx:=true;
            end;
            end;
 {$endif GDB}
 {$endif GDB}
       end;
       end;
@@ -1816,11 +1857,14 @@ implementation
       begin
       begin
          unitsym:=nil;
          unitsym:=nil;
          unitid:=0;
          unitid:=0;
-         if (current_module^.flags and uf_has_dbx)<>0 then
+{$ifdef GDB}
+         if cs_gdb_dbx in aktglobalswitches then
            begin
            begin
+              UnitTypeCount:=1;
               storeGlobalTypeCount:=PGlobalTypeCount;
               storeGlobalTypeCount:=PGlobalTypeCount;
               PglobalTypeCount:=@UnitTypeCount;
               PglobalTypeCount:=@UnitTypeCount;
            end;
            end;
+{$endif GDB}
 
 
        { load symtables }
        { load symtables }
          inherited load;
          inherited load;
@@ -1837,10 +1881,14 @@ implementation
               else
               else
                dbx_count := readlong;
                dbx_count := readlong;
               dbx_count_ok := true;
               dbx_count_ok := true;
-              PGlobalTypeCount:=storeGlobalTypeCount;
            end
            end
          else
          else
-           dbx_count := 0;
+           begin
+             dbx_count := -1;
+             dbx_count_ok:=false;
+           end;
+         if cs_gdb_dbx in aktglobalswitches then
+           PGlobalTypeCount:=storeGlobalTypeCount;
          is_stab_written:=false;
          is_stab_written:=false;
 {$endif GDB}
 {$endif GDB}
 
 
@@ -1932,6 +1980,9 @@ implementation
       { write the symtable entries }
       { write the symtable entries }
         inherited write;
         inherited write;
 
 
+      { all after doesn't affect crc }
+        current_ppu^.do_crc:=false;
+
       { write dbx count }
       { write dbx count }
 {$ifdef GDB}
 {$ifdef GDB}
         if cs_gdb_dbx in aktglobalswitches then
         if cs_gdb_dbx in aktglobalswitches then
@@ -1945,8 +1996,6 @@ implementation
 {$endif GDB}
 {$endif GDB}
 
 
         current_ppu^.writeentry(ibendimplementation);
         current_ppu^.writeentry(ibendimplementation);
-        { all after doesn't affect crc }
-        current_ppu^.do_crc:=false;
 
 
          { write static symtable
          { write static symtable
            needed for local debugging of unit functions }
            needed for local debugging of unit functions }
@@ -1998,7 +2047,8 @@ implementation
         begin
         begin
            if is_stab_written then exit;
            if is_stab_written then exit;
            if not assigned(name) then name := stringdup('Main_program');
            if not assigned(name) then name := stringdup('Main_program');
-           if symtabletype = unitsymtable then
+           if (symtabletype = unitsymtable) and
+              (current_module^.globalsymtable<>@Self) then
              begin
              begin
                 unitid:=current_module^.unitcount;
                 unitid:=current_module^.unitcount;
                 inc(current_module^.unitcount);
                 inc(current_module^.unitcount);
@@ -2009,32 +2059,41 @@ implementation
              begin
              begin
                 if dbx_count_ok then
                 if dbx_count_ok then
                   begin
                   begin
-                     asmlist^.insert(new(pai_asm_comment,init(strpnew('"repeated" unit '+name^
-                              +' has index '+tostr(unitid)))));
-                     do_count_dbx:=true;
+                     asmlist^.concat(new(pai_asm_comment,init(strpnew('"repeated" unit '+name^
+                              +' has index '+tostr(unitid)+' dbx count = '+tostr(dbx_count)))));
                      asmlist^.concat(new(pai_stabs,init(strpnew('"'+name^+'",'
                      asmlist^.concat(new(pai_stabs,init(strpnew('"'+name^+'",'
                        +tostr(N_EXCL)+',0,0,'+tostr(dbx_count)))));
                        +tostr(N_EXCL)+',0,0,'+tostr(dbx_count)))));
                      exit;
                      exit;
+                  end
+                else if (current_module^.globalsymtable<>@Self) then
+                  begin
+                    prev_dbx_count := dbx_counter;
+                    dbx_counter := nil;
+                    do_count_dbx:=false;
+                    if symtabletype = unitsymtable then
+                      asmlist^.concat(new(pai_stabs,init(strpnew('"'+name^+'",'
+                        +tostr(N_BINCL)+',0,0,0'))));
+                    dbx_counter := @dbx_count;
+                    dbx_count:=0;
+                    do_count_dbx:=assigned(dbx_counter);
                   end;
                   end;
-                prev_dbx_count := dbx_counter;
-                dbx_counter := nil;
-                if symtabletype = unitsymtable then
-                  asmlist^.concat(new(pai_stabs,init(strpnew('"'+name^+'",'
-                    +tostr(N_BINCL)+',0,0,0'))));
-                dbx_counter := @dbx_count;
              end;
              end;
            asmoutput:=asmlist;
            asmoutput:=asmlist;
            foreach({$ifndef TP}@{$endif}concattypestab);
            foreach({$ifndef TP}@{$endif}concattypestab);
            if cs_gdb_dbx in aktglobalswitches then
            if cs_gdb_dbx in aktglobalswitches then
              begin
              begin
-                dbx_counter := prev_dbx_count;
-                do_count_dbx:=true;
-                asmlist^.concat(new(pai_stabs,init(strpnew('"'+name^+'",'
-                  +tostr(N_EINCL)+',0,0,0'))));
-                dbx_count_ok := true;
+                if (current_module^.globalsymtable<>@Self) then
+                  begin
+                    dbx_counter := prev_dbx_count;
+                    do_count_dbx:=false;
+                    asmlist^.concat(new(pai_asm_comment,init(strpnew('End unit '+name^
+                      +' has index '+tostr(unitid)))));
+                    asmlist^.concat(new(pai_stabs,init(strpnew('"'+name^+'",'
+                      +tostr(N_EINCL)+',0,0,0'))));
+                    do_count_dbx:=assigned(dbx_counter);
+                    dbx_count_ok := true;
+                  end;
              end;
              end;
-           asmlist^.concat(new(pai_asm_comment,init(strpnew('End unit '+name^
-                  +' has index '+tostr(unitid)))));
            is_stab_written:=true;
            is_stab_written:=true;
         end;
         end;
 {$endif}
 {$endif}
@@ -2406,7 +2465,12 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.56  1999-11-04 23:13:25  peter
+  Revision 1.57  1999-11-05 17:18:03  pierre
+    * local browsing works at first level
+      ie for function defined in interface or implementation
+      not yet for functions inside other functions
+
+  Revision 1.56  1999/11/04 23:13:25  peter
     * moved unit alias support into ifdef
     * moved unit alias support into ifdef
 
 
   Revision 1.55  1999/11/04 10:54:02  peter
   Revision 1.55  1999/11/04 10:54:02  peter