12.3 About frame directives

Frame directives enable debugging and profiling of assembly language functions. They also enable the stack usage of functions to be calculated.

Correct use of these directives:
  • Enables the armlink --callgraph option to calculate stack usage of assembler functions.
    The following are the rules that determine stack usage:
    • If a function is not marked with PROC or ENDP, stack usage is unknown.
    • If a function is marked with PROC or ENDP but with no FRAME PUSH or FRAME POP, stack usage is assumed to be zero. This means that there is no requirement to manually add FRAME PUSH 0 or FRAME POP 0.
    • If a function is marked with PROC or ENDP and with FRAME PUSH n or FRAME POP n, stack usage is assumed to be n bytes.
  • Helps you to avoid errors in function construction, particularly when you are modifying existing code.
  • Enables the assembler to alert you to errors in function construction.
  • Enables backtracing of function calls during debugging.
  • Enables the debugger to profile assembler functions.
If you require profiling of assembler functions, but do not want frame description directives for other purposes:
  • You must use the FUNCTION and ENDFUNC, or PROC and ENDP, directives.
  • You can omit the other FRAME directives.
  • You only have to use the FUNCTION and ENDFUNC directives for the functions you want to profile.
In DWARF, the canonical frame address is an address on the stack specifying where the call frame of an interrupted function is located.
Related reference
12.31 FRAME ADDRESS
12.32 FRAME POP
12.33 FRAME PUSH
12.34 FRAME REGISTER
12.35 FRAME RESTORE
12.36 FRAME RETURN ADDRESS
12.37 FRAME SAVE
12.38 FRAME STATE REMEMBER
12.39 FRAME STATE RESTORE
12.40 FRAME UNWIND ON
12.41 FRAME UNWIND OFF
12.42 FUNCTION or PROC
12.25 ENDFUNC or ENDP
Non-ConfidentialPDF file icon PDF versionARM DUI0379G
Copyright © 2007, 2008, 2011, 2012, 2014, 2015 ARM. All rights reserved.