Browse Source

* tsymtable.dump to dump the names in a symtable to stdout

peter 23 years ago
parent
commit
a6bdf6703d
1 changed files with 29 additions and 1 deletions
  1. 29 1
      compiler/symbase.pas

+ 29 - 1
compiler/symbase.pas

@@ -90,6 +90,10 @@ interface
        psearchhasharray = ^tsearchhasharray;
        psearchhasharray = ^tsearchhasharray;
 
 
        tsymtable = class
        tsymtable = class
+{$ifdef EXTDEBUG}
+       private
+          procedure dumpsym(p : TNamedIndexItem;arg:pointer);
+{$endif EXTDEBUG}
        public
        public
           name      : pstring;
           name      : pstring;
           realname  : pstring;
           realname  : pstring;
@@ -122,6 +126,9 @@ interface
           function  search(const s : stringid) : tsymentry;
           function  search(const s : stringid) : tsymentry;
           function  speedsearch(const s : stringid;speedvalue : cardinal) : tsymentry;virtual;
           function  speedsearch(const s : stringid;speedvalue : cardinal) : tsymentry;virtual;
           procedure registerdef(p : tdefentry);
           procedure registerdef(p : tdefentry);
+{$ifdef EXTDEBUG}
+          procedure dump;
+{$endif EXTDEBUG}
           function  getdefnr(l : longint) : tdefentry;
           function  getdefnr(l : longint) : tdefentry;
           function  getsymnr(l : longint) : tsymentry;
           function  getsymnr(l : longint) : tsymentry;
 {$ifdef GDB}
 {$ifdef GDB}
@@ -203,6 +210,24 @@ implementation
       end;
       end;
 
 
 
 
+{$ifdef EXTDEBUG}
+    procedure tsymtable.dumpsym(p : TNamedIndexItem;arg:pointer);
+      begin
+        writeln(p.name);
+      end;
+
+
+    procedure tsymtable.dump;
+      begin
+        if assigned(name) then
+          writeln('Symtable ',name^)
+        else
+          writeln('Symtable <not named>');
+        symsearch.foreach({$ifdef FPCPROCVAR}@{$endif}dumpsym,nil);
+      end;
+{$endif EXTDEBUG}
+
+
     procedure tsymtable.registerdef(p : tdefentry);
     procedure tsymtable.registerdef(p : tdefentry);
       begin
       begin
          defindex.insert(p);
          defindex.insert(p);
@@ -323,7 +348,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.8  2002-09-09 17:34:15  peter
+  Revision 1.9  2002-10-02 20:51:59  peter
+    * tsymtable.dump to dump the names in a symtable to stdout
+
+  Revision 1.8  2002/09/09 17:34:15  peter
     * tdicationary.replace added to replace and item in a dictionary. This
     * tdicationary.replace added to replace and item in a dictionary. This
       is only allowed for the same name
       is only allowed for the same name
     * varsyms are inserted in symtable before the types are parsed. This
     * varsyms are inserted in symtable before the types are parsed. This