From 1e4dc56155d14f7531da51fad19b8986bb669b1d Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 30 Sep 2020 21:18:33 +0000 Subject: [PATCH] * inlinable frame handling dummies for avr * inline frame handler if possible git-svn-id: trunk@47025 - --- rtl/avr/avr.inc | 21 +++++++++++++++------ rtl/inc/system.inc | 2 +- rtl/inc/systemh.inc | 8 ++++---- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/rtl/avr/avr.inc b/rtl/avr/avr.inc index 8f8aac1e21..cd07669688 100644 --- a/rtl/avr/avr.inc +++ b/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; diff --git a/rtl/inc/system.inc b/rtl/inc/system.inc index 3723bb54d2..8d62520a80 100644 --- a/rtl/inc/system.inc +++ b/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; diff --git a/rtl/inc/systemh.inc b/rtl/inc/systemh.inc index 0ae5f9b6c4..3a8b3a29ca 100644 --- a/rtl/inc/systemh.inc +++ b/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];