Browse Source

* -gl switch for auto lineinfo including

peter 25 years ago
parent
commit
f0efb42197
3 changed files with 37 additions and 14 deletions
  1. 5 2
      compiler/globtype.pas
  2. 5 1
      compiler/options.pas
  3. 27 11
      compiler/pmodules.pas

+ 5 - 2
compiler/globtype.pas

@@ -99,7 +99,7 @@ interface
          { browser }
          { browser }
          cs_browser_log,
          cs_browser_log,
          { debugger }
          { debugger }
-         cs_gdb_dbx,cs_gdb_gsym,cs_gdb_heaptrc,cs_checkpointer,
+         cs_gdb_dbx,cs_gdb_gsym,cs_gdb_heaptrc,cs_gdb_lineinfo,cs_checkpointer,
          { assembling }
          { assembling }
          cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source,
          cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source,
          cs_asm_regalloc,cs_asm_tempalloc,
          cs_asm_regalloc,cs_asm_tempalloc,
@@ -180,7 +180,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.25  2000-01-07 01:14:27  peter
+  Revision 1.26  2000-02-06 17:20:52  peter
+    * -gl switch for auto lineinfo including
+
+  Revision 1.25  2000/01/07 01:14:27  peter
     * updated copyright to 2000
     * updated copyright to 2000
 
 
   Revision 1.24  1999/11/12 11:03:50  peter
   Revision 1.24  1999/11/12 11:03:50  peter

+ 5 - 1
compiler/options.pas

@@ -591,6 +591,7 @@ begin
                            'd' : initglobalswitches:=initglobalswitches+[cs_gdb_dbx];
                            'd' : initglobalswitches:=initglobalswitches+[cs_gdb_dbx];
                            'g' : initglobalswitches:=initglobalswitches+[cs_gdb_gsym];
                            'g' : initglobalswitches:=initglobalswitches+[cs_gdb_gsym];
                            'h' : initglobalswitches:=initglobalswitches+[cs_gdb_heaptrc];
                            'h' : initglobalswitches:=initglobalswitches+[cs_gdb_heaptrc];
+                           'l' : initglobalswitches:=initglobalswitches+[cs_gdb_lineinfo];
                            'c' : initglobalswitches:=initglobalswitches+[cs_checkpointer];
                            'c' : initglobalswitches:=initglobalswitches+[cs_checkpointer];
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
                            'p' : only_one_pass:=true;
                            'p' : only_one_pass:=true;
@@ -1427,7 +1428,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.56  2000-01-31 15:55:42  peter
+  Revision 1.57  2000-02-06 17:20:52  peter
+    * -gl switch for auto lineinfo including
+
+  Revision 1.56  2000/01/31 15:55:42  peter
     * fixed default unit location for linux when fpcdir was not set
     * fixed default unit location for linux when fpcdir was not set
 
 
   Revision 1.55  2000/01/23 18:20:50  sg
   Revision 1.55  2000/01/23 18:20:50  sg

+ 27 - 11
compiler/pmodules.pas

@@ -659,19 +659,32 @@ unit pmodules;
            current_module^.used_units.concat(new(pused_unit,init(hp,true)));
            current_module^.used_units.concat(new(pused_unit,init(hp,true)));
            refsymtable^.insert(new(punitsym,init('PROFILE',hp^.globalsymtable)));
            refsymtable^.insert(new(punitsym,init('PROFILE',hp^.globalsymtable)));
          end;
          end;
-      { Heaptrc unit? (not needed for units), this is here to be sure that it is really
-        loaded as first unit }
-        if (cs_gdb_heaptrc in aktglobalswitches) and not(current_module^.is_unit)then
+      { Units only required for main module }
+        if not(current_module^.is_unit) then
          begin
          begin
-           hp:=loadunit('HEAPTRC',false);
-           psymtable(hp^.globalsymtable)^.next:=symtablestack;
-           symtablestack:=hp^.globalsymtable;
-           { add to the used units }
-           current_module^.used_units.concat(new(pused_unit,init(hp,true)));
-           refsymtable^.insert(new(punitsym,init('HEAPTRC',hp^.globalsymtable)));
+           { Heaptrc unit }
+           if (cs_gdb_heaptrc in aktglobalswitches) then
+            begin
+              hp:=loadunit('HEAPTRC',false);
+              psymtable(hp^.globalsymtable)^.next:=symtablestack;
+              symtablestack:=hp^.globalsymtable;
+              { add to the used units }
+              current_module^.used_units.concat(new(pused_unit,init(hp,true)));
+              refsymtable^.insert(new(punitsym,init('HEAPTRC',hp^.globalsymtable)));
+            end;
+           { Lineinfo unit }
+           if (cs_gdb_lineinfo in aktglobalswitches) then
+            begin
+              hp:=loadunit('LINEINFO',false);
+              psymtable(hp^.globalsymtable)^.next:=symtablestack;
+              symtablestack:=hp^.globalsymtable;
+              { add to the used units }
+              current_module^.used_units.concat(new(pused_unit,init(hp,true)));
+              refsymtable^.insert(new(punitsym,init('LINEINFO',hp^.globalsymtable)));
+            end;
          end;
          end;
       { save default symtablestack }
       { save default symtablestack }
-         defaultsymtablestack:=symtablestack;
+        defaultsymtablestack:=symtablestack;
       end;
       end;
 
 
 
 
@@ -1619,7 +1632,10 @@ unit pmodules;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.183  2000-01-16 22:17:12  peter
+  Revision 1.184  2000-02-06 17:20:53  peter
+    * -gl switch for auto lineinfo including
+
+  Revision 1.183  2000/01/16 22:17:12  peter
     * renamed call_offset to para_offset
     * renamed call_offset to para_offset
 
 
   Revision 1.182  2000/01/16 14:15:33  jonas
   Revision 1.182  2000/01/16 14:15:33  jonas