Brian Xu - Sun Microsystems - Beijing China wrote:
> Oliver Yang ??:
>
>> Brian Xu - Sun Microsystems - Beijing China wrote:
>>
>>> Hi,
>>>
>>> I have a question: how the cmd '::findstack -v' in mdb works?
>>>
>>> In x32, it is easy to understand, since all the args are on the stack,
>>> while for amd64, since the args(<6) are not put on the stack, and those
>>> regs used to pass args(rdi, rsi, rdx, rcx, r8, r9) may be reused within
>>> the function, so I am curious when backtracing the stack, how to know
>>> the value of the args passed to the function's father, grandfather,
>>> great grandfather, etc?
>>>
>> Hi,
>>
>> In below Eric Schrock's blog, it said it was difficult to get them,
>> since the arguments may
>> or may not be pushed on the stack, or they could be lost completely.
>>
>> http://blogs.sun.com/eschrock/entry/debugging_on_amd64_part_two
>>
>> It seems to be true in the earlier Nevada build, but in recent Neveda
>> build, ::findstack could
>> return the input arguments very well.
>>
> Yes. the args are saved now on the stack. It is on the callee's stack
> instead of that on the caller's stack for 32bit.
>
I think this new behaviors are caused by the changes of SUN Studio
compiler, which
should not be a standard amd64 ABI.