dbx strcpy arguments

Solaris 8dbx shows medbx) where=>[1] strncpy(0x4c0a2f3, 0x0, 0x51, 0x3, 0xffbe92a2, 0x4c0a2f3), at 0xfd6336b4why so many parameters, what they mean and where I can look to read more detailed description?Thanks
[254 byte] By [gshcherb@gmail.com] at [2007-11-26 10:37:38]
# 1

When no debug information exists for a function, dbx does not know how many arguments were passed to it. It arbitrarily displays the data in the locations where the first 6 arguments probably would be passed. Apart from nonsense values for non-existent parameters, the data is not always accurate.

clamage45 at 2007-7-7 2:48:43 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

Thanks for the answer. As for the values accuracy I also noticed that. In my case first parameter equal to 0x4c0a2f3. I always thought that user data addresses always should be mapped in high region of the virtual memory. Do you know is it correct ? or why the first parameter has such strange value?

Thanks.

gshcherb@gmailcom at 2007-7-7 2:48:43 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3

The base address of static data and the base of the stack depends on the platform and whether the code is 32-bit or 64 bit. The Solaris ABI supplement for each architecture defines the memory layout.

The address 0x4c0a2f3 does not look like the address of any data object, so it probably is bogus. As I said, when there is no debug data, dbx guesses where to find the data. On sparc in particular, a function compiled as a leaf function (one that calls no other function) does not have a stack frame, so the dbx guess is wrong.

clamage45 at 2007-7-7 2:48:43 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4

When no debug info is available for a function, dbx displays contents of out or in registers as function parameters (assuming that you're on sparc). Sparc provides six registers for parameters passing: o0-o5 (o6 and o7 are reserved by the ABI) -- this is why you see six parameters in strcpy() call.

Of course, not all of them are used by the function, but as to leaf functions that get their parameters through 'in' registers rather than 'out', dbx does its best to detect such a function and present correct registers as this function parameters.

In case of strcpy(), it is a leaf function in Solaris 10 and not a leaf function in, for example, Solaris 8's libc.so. So in the first case dbx will display 'out' registers as strcpy() parameters and in the second case, it will display 'in' registers (assuming function prologue, a 'save' instruction, has been executed and new reg window is allocated; before that, it will display out regs).

MaximKartashev at 2007-7-7 2:48:43 > top of Java-index,Development Tools,Solaris and Linux Development Tools...