Compiler Conventions
Compiler Conventions
In order to write assembly language procedures that can both call to and be called from
On many computer systems, each
There is, however, a standard
Besides defining a uniform call and return sequence for all languages, the calling convention is important for other reasons. In order to streamline the calling sequence, the return link is not saved on the stack unless necessary and the previous stack pointer is rarely saved on the stack. Therefore, it is not usually possible to obtain a stack trace at an arbitrary point in the program without some additional static information about each procedure's stack frame size and usage.
For example, you could not obtain a stack trace while debugging or analyzing a core dump, or using the TRY/RECOVER feature in HP
Each descriptor contains the starting and ending address of a procedure's object code, plus that procedure's stack frame size, and a few flags indicating, among other things, whether the return link is saved on the stack. Given the current program counter and stack pointer, the stack unwind mechanism can determine the calling procedure by finding
Chapter 3 | 47 |