User`s guide
48
Chapter 5: Examining and Changing Data
{
fooexample(3,4,5);
return 0;
}
int fooexample(int i, int j, int k)
{
int x = i + j + 3*k;
return x;
}
The examples below show register values from code compiled without a –g
option. MIPS1 or MIPS2 code using the 32-bit ABI (for example, on an Indy):
(dbx) where
> 0 subr1(0x3, 0x7fffaf14, 0x7fffaf1c, 0x0) [“t.c”:3, 0x4009ec]
1 test(0x3, 0x7fffaf14, 0x7fffaf1c, 0x0) [“t.c”:8, 0x400a10]
2 main(0x1, 0x7fffaf14, 0x7fffaf1c, 0x0) [“t.c”:13, 0x400a48]
3 __start() [“crt1text.s”:133, 0x40099c]
There are four hexadecimal values displayed in most lines of the code above
since the 32-bit MIPS ABI has four integer argument passing registers. No
user-useful registers are passed to __start().
MIPS3 or MIPS4 code using the 64-bit ABI (for example, on a Power
Challenge):
(dbx) where
> 0 subr1(0x3, 0xffffffaed8, 0xffffffaee8, 0x0, 0x2f, 0x10, 0x0, 0xfbd82a0) [“/
usr/people/doc/debug/t.c”:3, 0x10000c9c]
1 test(0x3, 0xffffffaed8, 0xffffffaee8, 0x0, 0x2f, 0x10, 0x0, 0xfbd82a0) [“/
usr/people/doc/debug/t.c”:9, 0x10000ce8]
2 main(0x1000000ff, 0xffffffaed8, 0xffffffaee8, 0x0, 0x2f, 0x10, 0x0,
0xfbd82a0) [“/usr/people/doc/debug/t.c”:14, 0x10000d2c]
3 __start() [“/shamu/redwood2/work/irix/lib/libc/libc_64/csu/crt1text.s”:137,
0x10000c70]
There are eight hexadecimal values displayed in most lines of the code above
since the 64-bit MIPS ABI has eight integer argument passing registers. No
user-useful registers are passed to __start().
The values listed as arguments are the integer argument-passing register
values. Typically, only the 0 entry of the stack has those argument values
correct. Correctness is not guaranteed because the code generator can
overwrite the values, using the registers as temporary variables.