Bläddra i källkod

* put Charlie's writeln debugger between DEBUG_CHARLIE conditional compilation symbols

git-svn-id: trunk@8503 -
florian 18 år sedan
förälder
incheckning
bd4bb505b3
3 ändrade filer med 35 tillägg och 6 borttagningar
  1. 7 4
      compiler/m68k/ag68kgas.pas
  2. 22 2
      compiler/m68k/cgcpu.pas
  3. 6 0
      compiler/m68k/cpupara.pas

+ 7 - 4
compiler/m68k/ag68kgas.pas

@@ -299,9 +299,12 @@ interface
          s:=gas_op2str[op]+cond2str[taicpu(hp).condition]+gas_opsize2str[taicpu(hp).opsize]
         else
          s:=gas_op2str[op]+gas_opsize2str[taicpu(hp).opsize];
-        if op = A_FMOVE then begin
-          writeln('fmove! opsize:',dword(taicpu(hp).opsize));
-        end;
+        if op = A_FMOVE then
+          begin
+{$ifdef DEBUG_CHARLIE}
+            writeln('fmove! opsize:',dword(taicpu(hp).opsize));
+{$endif DEBUG_CHARLIE}
+          end;
         getopcodestring:=s;
       end;
 
@@ -330,7 +333,7 @@ interface
                   owner.AsmWrite(s+#9);
                   s:=getopstr_jmp(taicpu(hp).oper[0]^);
                   { dbcc dx,<sym> has two operands! (KB) }
-                  if (taicpu(hp).ops>1) then 
+                  if (taicpu(hp).ops>1) then
                     s:=s+','+getopstr_jmp(taicpu(hp).oper[1]^);
                   if (taicpu(hp).ops>2) then
                     internalerror(2006120501);

+ 22 - 2
compiler/m68k/cgcpu.pas

@@ -235,8 +235,9 @@ unit cgcpu;
         pushsize : tcgsize;
         ref : treference;
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('a_param_reg');
-
+{$endif DEBUG_CHARLIE}
         { it's probably necessary to port this from x86 later, or provide an m68k solution (KB) }
 {$WARNING FIX ME! check_register_size()}
         // check_register_size(size,r);
@@ -262,8 +263,9 @@ unit cgcpu;
         pushsize : tcgsize;
         ref : treference;
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('a_param_const');
-
+{$endif DEBUG_CHARLIE}
         { remove "not" to trigger the location bug (KB) }
         if use_push(cgpara) then
           begin
@@ -330,7 +332,9 @@ unit cgcpu;
         len : aint;
         href : treference;
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('a_param_ref');
+{$endif DEBUG_CHARLIE}
 
         { cgpara.size=OS_NO requires a copy on the stack }
         if use_push(cgpara) then
@@ -363,7 +367,9 @@ unit cgcpu;
         tmpreg : tregister;
         opsize : topsize;
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('a_paramaddr_ref');
+{$endif DEBUG_CHARLIE}
         with r do
           begin
             { i suppose this is not required for m68k (KB) }
@@ -459,7 +465,9 @@ unit cgcpu;
 
     procedure tcg68k.a_load_const_reg(list : TAsmList;size : tcgsize;a : aint;register : tregister);
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('a_load_const_reg');
+{$endif DEBUG_CHARLIE}
 
         if getregtype(register)=R_ADDRESSREGISTER then
          begin
@@ -479,7 +487,9 @@ unit cgcpu;
 
     procedure tcg68k.a_load_const_ref(list : TAsmList; tosize: tcgsize; a : aint;const ref : treference);
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('a_load_const_ref');
+{$endif DEBUG_CHARLIE}
 
         list.concat(taicpu.op_const_ref(A_MOVE,S_L,longint(a),ref));
       end;
@@ -491,7 +501,9 @@ unit cgcpu;
       begin
          href := ref;
          fixref(list,href);
+{$ifdef DEBUG_CHARLIE}
          writeln('a_load_reg_ref');
+{$endif DEBUG_CHARLIE}
          { move to destination reference }
          list.concat(taicpu.op_reg_ref(A_MOVE,TCGSize2OpSize[fromsize],register,href));
       end;
@@ -506,7 +518,9 @@ unit cgcpu;
         bref := dref;
         fixref(list,aref);
         fixref(list,bref);
+{$ifdef DEBUG_CHARLIE}
         writeln('a_load_ref_ref');
+{$endif DEBUG_CHARLIE}
         list.concat(taicpu.op_ref_ref(A_MOVE,TCGSize2OpSize[fromsize],aref,bref));
       end;
 
@@ -1263,7 +1277,9 @@ unit cgcpu;
         r,rsp: TRegister;
         ref  : TReference;
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('proc entry, localsize:',localsize);
+{$endif DEBUG_CHARLIE}
 
         if not nostackframe then
           begin
@@ -1316,7 +1332,9 @@ unit cgcpu;
         if not nostackframe then
           begin
             localsize := current_procinfo.calc_stackframe_size;
+{$ifdef DEBUG_CHARLIE}
             writeln('proc exit with stackframe, size:',localsize);
+{$endif DEBUG_CHARLIE}
             list.concat(taicpu.op_reg(A_UNLK,S_NO,NR_FRAME_POINTER_REG));
             if (localsize<>0) then
               begin
@@ -1331,7 +1349,9 @@ unit cgcpu;
           end
         else
           begin
+{$ifdef DEBUG_CHARLIE}
             writeln('proc exit, no stackframe');
+{$endif DEBUG_CHARLIE}
             list.concat(taicpu.op_none(A_RTS,S_NO));
           end;
 

+ 6 - 0
compiler/m68k/cpupara.pas

@@ -307,7 +307,9 @@ unit cpupara;
             if (p.proccalloption in [pocall_cdecl,pocall_cppdecl]) and
                is_array_of_const(paradef) then
               begin
+{$ifdef DEBUG_CHARLIE}
                 writeln('loc register');
+{$endif DEBUG_CHARLIE}
                 paraloc:=hp.paraloc[side].add_location;
                 { hack: the paraloc must be valid, but is not actually used }
                 paraloc^.loc:=LOC_REGISTER;
@@ -321,7 +323,9 @@ unit cpupara;
                is_open_array(paradef) or
                is_array_of_const(paradef) then
               begin
+{$ifdef DEBUG_CHARLIE}
                 writeln('loc register');
+{$endif DEBUG_CHARLIE}
                 paradef:=voidpointertype;
                 loc:=LOC_REGISTER;
                 paracgsize := OS_ADDR;
@@ -391,7 +395,9 @@ unit cpupara;
                 else { LOC_REFERENCE }
 }
                   begin
+{$ifdef DEBUG_CHARLIE}
 		    writeln('loc reference');
+{$endif DEBUG_CHARLIE}
                     paraloc^.loc:=LOC_REFERENCE;
                     paraloc^.size:=int_cgsize(paralen);
                     if (side = callerside) then