User`s guide
50
Chapter 5: Examining and Changing Data
(dbx) print i
5
(dbx) up
foo: 40 r = foo2(i+1);
The current activation level is now the procedure foo. As indicated in the
output, the variable i receives the argument passed to foo and is therefore
local to foo. The variable i at this activation level is different from the
variable i in the foo2 activation level. You can reference the currently active
i as “i”; whereas you must qualify the reference to the i in foo2:
(dbx) print i
4
(dbx) print foo2.i
<symbol not found>
Moving up one more activation level brings you to the main procedure:
(dbx) up
main: 25 j = foo(j);
(dbx) file
/usr/var/tmp/dbx_examples/test4.c
In this example, the source for main is in test4.c, whereas the source for foo
and foo2 is in foo.c; therefore, dbx changes the current source file when you
move up to the main activation level.
dbx resets the source file when you return to the foo2 activation level:
(dbx) down 2
foo2: 46 printf(“foo2 arg is %d\n”,i);
(dbx) file
/usr/var/tmp/dbx_examples/foo.c
Moving to a Specified Procedure
The func command moves you up or down the activation stack. You can
specify the new activation level by providing either a procedure name or an
activation level number.