瀏覽代碼

* improved CFI

git-svn-id: branches/debug_eh@41356 -
florian 6 年之前
父節點
當前提交
3567d01ee4
共有 2 個文件被更改,包括 5 次插入1 次删除
  1. 1 0
      compiler/i386/cgcpu.pas
  2. 4 1
      compiler/x86/cgx86.pas

+ 1 - 0
compiler/i386/cgcpu.pas

@@ -323,6 +323,7 @@ unit cgcpu;
                   internal_restore_regs(list,true);
                 if (current_procinfo.procdef.proctypeoption=potype_exceptfilter) then
                   list.concat(Taicpu.op_reg(A_POP,tcgsize2opsize[OS_ADDR],NR_FRAME_POINTER_REG));
+                current_asmdata.asmcfi.cfa_def_cfa_offset(list,sizeof(pint));
               end
             else
               begin

+ 4 - 1
compiler/x86/cgx86.pas

@@ -3405,7 +3405,10 @@ unit cgx86;
                 inc(regsize,sizeof(aint));
                 hreg:=newreg(R_INTREGISTER,regs_to_save_int[r],R_SUBWHOLE);
                 list.concat(Taicpu.Op_reg(A_PUSH,tcgsize2opsize[OS_ADDR],hreg));
-                current_asmdata.asmcfi.cfa_offset(list,hreg,-(regsize+localsize));
+                if current_procinfo.framepointer<>NR_STACK_POINTER_REG then
+                  current_asmdata.asmcfi.cfa_offset(list,hreg,-(regsize+sizeof(pint)*2+localsize))
+                else
+                  current_asmdata.asmcfi.cfa_offset(list,hreg,-(regsize+sizeof(pint)+localsize));
               end;
         end;