Browse Source

* fix for first line of function break

pierre 27 years ago
parent
commit
920691ac0a

+ 5 - 1
compiler/aasm.pas

@@ -66,6 +66,7 @@ unit aasm;
           ait_const_rva,
           ait_stabn,
           ait_stabs,
+          ait_force_line,
           ait_stab_function_name,
           ait_cut, { used to split into tiny assembler files }
           ait_regalloc,
@@ -912,7 +913,10 @@ uses
 end.
 {
   $Log$
-  Revision 1.23  1998-10-14 15:56:37  pierre
+  Revision 1.24  1998-11-12 11:19:30  pierre
+   * fix for first line of function break
+
+  Revision 1.23  1998/10/14 15:56:37  pierre
     * all references to comp suppressed for m68k
 
   Revision 1.22  1998/10/12 12:20:38  pierre

+ 5 - 1
compiler/ag386int.pas

@@ -545,6 +545,7 @@ ait_labeled_instruction : AsmWriteLn(#9#9+int_op2str[pai_labeled(hp)^._operator]
 {$ifdef GDB}
              ait_stabn,
              ait_stabs,
+        ait_force_line,
 ait_stab_function_name : ;
 {$endif GDB}
          else
@@ -593,7 +594,10 @@ ait_stab_function_name : ;
 end.
 {
   $Log$
-  Revision 1.17  1998-10-12 12:20:40  pierre
+  Revision 1.18  1998-11-12 11:19:33  pierre
+   * fix for first line of function break
+
+  Revision 1.17  1998/10/12 12:20:40  pierre
     + added tai_const_symbol_offset
       for r : pointer = @var.field;
     * better message for different arg names on implementation

+ 5 - 1
compiler/ag386nsm.pas

@@ -540,6 +540,7 @@ ait_labeled_instruction :
 {$ifdef GDB}
              ait_stabn,
              ait_stabs,
+        ait_force_line,
 ait_stab_function_name : ;
 {$endif GDB}
         ait_marker : ;
@@ -583,7 +584,10 @@ ait_stab_function_name : ;
 end.
 {
   $Log$
-  Revision 1.11  1998-10-12 12:20:42  pierre
+  Revision 1.12  1998-11-12 11:19:34  pierre
+   * fix for first line of function break
+
+  Revision 1.11  1998/10/12 12:20:42  pierre
     + added tai_const_symbol_offset
       for r : pointer = @var.field;
     * better message for different arg names on implementation

+ 7 - 1
compiler/ag68kgas.pas

@@ -579,6 +579,9 @@ ait_labeled_instruction : begin
                        AsmWritePChar(pai_stabn(hp)^.str);
                        AsmLn;
                      end;
+    ait_force_line : begin
+                        stabslastfileinfo.line:=0;
+                     end;
 ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
 {$endif GDB}
            ait_cut : begin
@@ -696,7 +699,10 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
 end.
 {
   $Log$
-  Revision 1.19  1998-10-29 11:35:36  florian
+  Revision 1.20  1998-11-12 11:19:35  pierre
+   * fix for first line of function break
+
+  Revision 1.19  1998/10/29 11:35:36  florian
     * some dll support for win32
     * fixed assembler writing for PalmOS
 

+ 7 - 1
compiler/ag68kmit.pas

@@ -572,6 +572,9 @@ ait_labeled_instruction : begin
                        AsmWritePChar(pai_stabn(hp)^.str);
                        AsmLn;
                      end;
+    ait_force_line : begin
+                        stabslastfileinfo.line:=0;
+                     end;
 ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
 {$endif GDB}
            ait_cut : begin
@@ -658,7 +661,10 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
 end.
 {
   $Log$
-  Revision 1.15  1998-10-29 11:35:37  florian
+  Revision 1.16  1998-11-12 11:19:36  pierre
+   * fix for first line of function break
+
+  Revision 1.15  1998/10/29 11:35:37  florian
     * some dll support for win32
     * fixed assembler writing for PalmOS
 

+ 5 - 1
compiler/ag68kmot.pas

@@ -497,6 +497,7 @@ ait_labeled_instruction :
 {$ifdef GDB}
               ait_stabn,
               ait_stabs,
+         ait_force_line,
  ait_stab_function_name : ;
 {$endif GDB}
         ait_marker : ;
@@ -540,7 +541,10 @@ ait_labeled_instruction :
 end.
 {
   $Log$
-  Revision 1.13  1998-10-29 11:35:38  florian
+  Revision 1.14  1998-11-12 11:19:38  pierre
+   * fix for first line of function break
+
+  Revision 1.13  1998/10/29 11:35:38  florian
     * some dll support for win32
     * fixed assembler writing for PalmOS
 

+ 5 - 1
compiler/ag68kmpw.pas

@@ -533,6 +533,7 @@ ait_labeled_instruction :
 {$ifdef GDB}
               ait_stabn,
               ait_stabs,
+         ait_force_line,
  ait_stab_function_name : ;
 {$endif GDB}
         ait_marker : ;
@@ -579,7 +580,10 @@ ait_labeled_instruction :
 end.
 {
   $Log$
-  Revision 1.6  1998-10-29 11:35:39  florian
+  Revision 1.7  1998-11-12 11:19:39  pierre
+   * fix for first line of function break
+
+  Revision 1.6  1998/10/29 11:35:39  florian
     * some dll support for win32
     * fixed assembler writing for PalmOS
 

+ 27 - 1
compiler/cg386cal.pas

@@ -41,6 +41,9 @@ implementation
     uses
       cobjects,verbose,globals,systems,
       aasm,types,
+{$ifdef GDB}
+      gdb,
+{$endif GDB}
       hcodegen,temp_gen,pass_2,
       i386,cgai386,tgeni386,cg386ld;
 
@@ -310,6 +313,11 @@ implementation
                         inc(pushedparasize,size);
                         if not inlined then
                          exprasmlist^.concat(new(pai386,op_const_reg(A_SUB,S_L,size,R_ESP)));
+{$ifdef GDB}
+                        if (cs_debuginfo in aktmoduleswitches) and
+                           (exprasmlist^.first=exprasmlist^.last) then
+                          exprasmlist^.concat(new(pai_force_line,init));
+{$endif GDB}
                         r:=new_reference(R_ESP,0);
                         floatstoreops(pfloatdef(p^.left^.resulttype)^.typ,op,opsize);
                         { this is the easiest case for inlined !! }
@@ -523,6 +531,11 @@ implementation
                                   { create stack space }
                                   if not inlined then
                                     exprasmlist^.concat(new(pai386,op_const_reg(A_SUB,S_L,size,R_ESP)));
+{$ifdef GDB}
+                                  if (cs_debuginfo in aktmoduleswitches) and
+                                     (exprasmlist^.first=exprasmlist^.last) then
+                                    exprasmlist^.concat(new(pai_force_line,init));
+{$endif GDB}
                                   inc(pushedparasize,size);
                                   { create stack reference }
                                   stackref.symbol := nil;
@@ -622,6 +635,11 @@ implementation
                         inc(pushedparasize,8); { was missing !!! (PM) }
                         exprasmlist^.concat(new(pai386,op_const_reg(
                           A_SUB,S_L,8,R_ESP)));
+{$ifdef GDB}
+                        if (cs_debuginfo in aktmoduleswitches) and
+                           (exprasmlist^.first=exprasmlist^.last) then
+                          exprasmlist^.concat(new(pai_force_line,init));
+{$endif GDB}
                         if inlined then
                           begin
                              r:=new_reference(procinfo.framepointer,para_offset-pushedparasize);
@@ -775,6 +793,11 @@ implementation
              begin
                inc(pushedparasize,pop_size);
                exprasmlist^.concat(new(pai386,op_const_reg(A_SUB,S_L,pop_size,R_ESP)));
+{$ifdef GDB}
+               if (cs_debuginfo in aktmoduleswitches) and
+                  (exprasmlist^.first=exprasmlist^.last) then
+                 exprasmlist^.concat(new(pai_force_line,init));
+{$endif GDB}
              end;
           end;
 
@@ -1520,7 +1543,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.40  1998-11-10 10:09:08  peter
+  Revision 1.41  1998-11-12 11:19:40  pierre
+   * fix for first line of function break
+
+  Revision 1.40  1998/11/10 10:09:08  peter
     * va_list -> array of const
 
   Revision 1.39  1998/11/09 11:44:33  peter

+ 10 - 2
compiler/cg68kcal.pas

@@ -198,7 +198,12 @@ implementation
                    LOC_FPU : begin
                                         size:=pfloatdef(p^.left^.resulttype)^.size;
                                         inc(pushedparasize,size);
-                                        exprasmlist^.concat(new(pai68k,op_const_reg(A_SUBQ,S_L,size,R_SP)));
+                                        { how now how long a FPU is !! }
+                                        if (size > 0) and (size < 9) then
+                                          exprasmlist^.concat(new(pai68k,op_const_reg(A_SUBQ,S_L,size,R_SP)))
+                                        else
+                                          exprasmlist^.concat(new(pai68k,op_const_reg(A_SUBA,
+                                            S_L,size,R_SP)));
                                         new(r);
                                         reset_reference(r^);
                                         r^.base:=R_SP;
@@ -1057,7 +1062,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.14  1998-10-21 15:12:51  pierre
+  Revision 1.15  1998-11-12 11:19:41  pierre
+   * fix for first line of function break
+
+  Revision 1.14  1998/10/21 15:12:51  pierre
     * bug fix for IOCHECK inside a procedure with iocheck modifier
     * removed the GPF for unexistant overloading
       (firstcall was called with procedinition=nil !)

+ 6 - 15
compiler/cga68k.pas

@@ -529,7 +529,6 @@ var hs:string;
     unitinits:taasmoutput;
 {$ifdef GDB}
     stab_function_name:Pai_stab_function_name;
-    npai : pai;
 {$endif GDB}
 begin
     if (aktprocsym^.definition^.options and poproginit<>0) then
@@ -594,19 +593,8 @@ begin
     { don't load ESI, does the caller }
 
 {$ifdef GDB}
-      if (cs_debuginfo in aktmoduleswitches) and
-         (((aktprocsym^.definition^.options and poconstructor)<>0) or
-          ((aktprocsym^.definition^.options and poproginit)<>0)) then
-        begin
-           { add a stabn here so trace begins here }
-           if (aktprocsym^.definition^.options and poconstructor)<>0 then
-             npai:=new(pai_asm_comment,init(' constructor entry'))
-           else
-             npai:=new(pai_asm_comment,init(' program entry'));
-           { used to force the stabn to be written again !! }
-           npai^.fileinfo.line:=0;
-           list^.insert(npai);
-        end;
+      if (cs_debuginfo in aktmoduleswitches) then
+         list^.insert(new(pai_force_line,init));
 {$endif GDB}
       
     { omit stack frame ? }
@@ -1363,7 +1351,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.27  1998-11-12 09:46:17  pierre
+  Revision 1.28  1998-11-12 11:19:42  pierre
+   * fix for first line of function break
+
+  Revision 1.27  1998/11/12 09:46:17  pierre
     + break main stops before calls to unit inits
     + break at constructors stops before call to FPC_NEW_CLASS
       or FPC_HELP_CONSTRUCTOR

+ 17 - 1
compiler/gdb.pas

@@ -65,6 +65,12 @@ Const
           destructor done; virtual;
        end;
 
+       { insert a cut to split into several smaller files }
+       pai_force_line = ^tai_force_line;
+       tai_force_line = object(tai)
+          constructor init;
+       end;
+
        pai_stab_function_name = ^tai_stab_function_name;
 
        tai_stab_function_name = object(tai)
@@ -225,6 +231,13 @@ N_BINCL to N_EINCL
          inherited done;
       end;
 
+    constructor tai_force_line.init;
+
+      begin
+         inherited init;
+         typ:=ait_force_line;
+      end;
+
     constructor tai_stab_function_name.init(_str : pchar);
 
       begin
@@ -243,7 +256,10 @@ end.
 
 {
   $Log$
-  Revision 1.3  1998-09-22 17:13:45  pierre
+  Revision 1.4  1998-11-12 11:19:45  pierre
+   * fix for first line of function break
+
+  Revision 1.3  1998/09/22 17:13:45  pierre
     + browsing updated and developed
       records and objects fields are also stored