User`s guide
Examining the Stack
49
The debugger reports the integer argument-passing registers because this
information may be of some value.
For example, for the code samples above, the following code calls subr1():
int test(void)
{
subr1(3);
}
This code displays 0x3 as the argument register value. The other registers
listed for subr1 contain arbitrary data.
Moving Within the Stack
The up and down commands move up and down the activation levels in the
stack. These commands are useful when examining a call from one level to
another. You can also move up and down the activation stack with the func
command described in “Moving to a Specified Procedure” on page 50.
The up and down commands have the following syntax:
up [num] Moves up the specified number of activation levels in the
stack. The default is one level.
down [num] Moves down the specified number of activation levels in the
stack. The default is one level.
When you change activation levels, your scope changes. For example, unless
you qualify a variable, as described in “Qualifying Variable Names” on
page 39, dbx assumes that variables you reference are local to the current
activation level. Also, dbx changes the current source file to the file
containing the procedure’s source.
Consider examining the stack trace for a program called test4 and moving up
in the activation stack:
(dbx) where
> 0 foo2(i = 5) [“/usr/var/tmp/dbx_examples/foo.c”:46, 0x10001214]
1 foo(i = 4) [“/usr/var/tmp/dbx_examples/foo.c”:40, 0x100011d4]
2 main(argc = 1, argv = 0xffffffad78) [“/usr/var/tmp/dbx_examples/
test4.c”:25, 0x10000fa0]
3 __start() [“/shamu/lib/libc/libc_64/csu/crt1text.s”:137, 0x10000f34]