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
orENDP
, stack usage is unknown.If a function is marked with
PROC
orENDP
but with noFRAME PUSH
orFRAME POP
, stack usage is assumed to be zero. This means that there is no requirement to manually addFRAME PUSH 0
orFRAME POP 0
.If a function is marked with
PROC
orENDP
and withFRAME PUSH n
orFRAME POP n
, stack usage is assumed to ben
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
andENDFUNC
, orPROC
andENDP
, directives.You can omit the other
FRAME
directives.You only have to use the
FUNCTION
andENDFUNC
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.