Stack References - HP 68000 Series User Manual

Debugger/simulator
Table of Contents

Advertisement

Chapter 10: Expressions and Symbols in Debugger Commands
Symbolic Referencing
The examples in the following table show the differences in evaluation of these
symbol types.
Example
Breakpt Instr foo
Breakpt Access &i
Breakpt Access a
Breakpt Access a[3]
Breakpt Access &a[3]

Stack References

When a function is invoked in C, space is allocated on the stack for local
variables. If one function calls another function, all information is saved on
the stack to continue execution when the called function returns. The caller
function is now nested.
You can reference variables and functions on the stack implicitly or explicitly.
Implicit Stack References
The default compiler setting allocates storage for all local variables in a C
program in registers, if possible. Variables that cannot be stored in registers
are allocated storage on the stack. With the debugger, you can implicitly
reference variables on the stack as follows:
442
Function names and labels evaluate to addresses.
Variables generally evaluate to the contents of the memory location at the
address of the variable (the exception is unsubscripted array names which
evaluate to addresses.)
Symbol Evaluation Examples
Comment
The symbol foo is a function name. The
breakpoint is set at the address of foo.
i is a variable. Therefore, the debugger evaluates
the symbol as the value of i rather than the
address of i. The & operator causes the
breakpoint to be set on the address of i.
a is an array. The breakpoint is set at the address
of the first element of the array.
A breakpoint is set at the address specified in
a[3], not the address of a[3].
A breakpoint is set at the address of a[3].

Advertisement

Table of Contents
loading

This manual is also suitable for:

B1466

Table of Contents