瀏覽代碼

* inlinable frame handling dummies for avr
* inline frame handler if possible

git-svn-id: trunk@47025 -

florian 4 年之前
父節點
當前提交
1e4dc56155
共有 3 個文件被更改,包括 20 次插入11 次删除
  1. 15 6
      rtl/avr/avr.inc
  2. 1 1
      rtl/inc/system.inc
  3. 4 4
      rtl/inc/systemh.inc

+ 15 - 6
rtl/avr/avr.inc

@@ -93,21 +93,30 @@ end;
 
 {$IFNDEF INTERNAL_BACKTRACE}
 {$define FPC_SYSTEM_HAS_GET_FRAME}
-function get_frame:pointer;assembler;nostackframe;
-  asm
+{ this is never going to work on avr properly this way, so inline and return nil so the compiler
+  can optimize it }
+function get_frame:pointer;inline;
+  begin
+    result:=nil;
   end;
 {$ENDIF not INTERNAL_BACKTRACE}
 
 
 {$define FPC_SYSTEM_HAS_GET_CALLER_ADDR}
-function get_caller_addr(framebp:pointer;addr:pointer=nil):pointer;assembler;nostackframe;
-  asm
+{ this is never going to work on avr properly this way, so inline and return nil so the compiler
+  can optimize it }
+function get_caller_addr(framebp:pointer;addr:pointer=nil):pointer;inline;
+  begin
+    result:=nil;
   end;
 
 
 {$define FPC_SYSTEM_HAS_GET_CALLER_FRAME}
-function get_caller_frame(framebp:pointer;addr:pointer=nil):pointer;assembler;nostackframe;
-  asm
+{ this is never going to work on avr properly this way, so inline and return nil so the compiler
+  can optimize it }
+function get_caller_frame(framebp:pointer;addr:pointer=nil):pointer;inline;
+  begin
+    result:=nil;
   end;
 
 

+ 1 - 1
rtl/inc/system.inc

@@ -860,7 +860,7 @@ end;
   { This provides a dummy implementation
     of get_pc_addr function, for CPU's that don't need
     the instruction address to walk the stack. }
-function get_pc_addr : codepointer;
+function get_pc_addr : codepointer;inline;
 begin
   get_pc_addr:=nil;
 end;

+ 4 - 4
rtl/inc/systemh.inc

@@ -1473,15 +1473,15 @@ function get_caller_frame(framebp:pointer;addr:pointer=nil):pointer;[INTERNPROC:
 function get_frame:pointer;{$ifdef SYSTEMINLINE}inline;{$endif}
 {$ENDIF}
 
-Function Get_pc_addr : CodePointer;
+Function Get_pc_addr : CodePointer;{$ifdef SYSTEMINLINE}inline;{$endif}
 
 { Writes at most 'count' caller stack frames to pre-allocated buffer pointed to
   by 'frames', skipping 'skipframes' initial frames. Returns number of frames written. }
 function CaptureBacktrace(skipframes,count:sizeint;frames:PCodePointer):sizeint;
 
-function get_caller_addr(framebp:pointer;addr:codepointer=nil):codepointer;
-function get_caller_frame(framebp:pointer;addr:codepointer=nil):pointer;
-procedure get_caller_stackinfo(var framebp : pointer; var addr : codepointer);
+function get_caller_addr(framebp:pointer;addr:codepointer=nil):codepointer;{$ifdef SYSTEMINLINE}inline;{$endif}
+function get_caller_frame(framebp:pointer;addr:codepointer=nil):pointer;{$ifdef SYSTEMINLINE}inline;{$endif}
+procedure get_caller_stackinfo(var framebp : pointer; var addr : codepointer);{$ifdef SYSTEMINLINE}inline;{$endif}
 
 Function IOResult:Word;
 Function SPtr:Pointer;[internconst:fpc_in_const_ptr];