Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pstack output

144 views
Skip to first unread message

Salvatore Dolce

unread,
Jun 20, 2000, 3:00:00 AM6/20/00
to
Hi all,

Can someone tell me the format of the pstack output. I know that in
parenteshis there are the function parameters but sometimes the number
of the parameters are not respected.

Thanks in advance!
Eric


Andy Platt

unread,
Jun 20, 2000, 3:00:00 AM6/20/00
to
It just prints the first six registers since it has no clue to how many
parameters were actually passed. It doesn't look at the debug information.

Andy.

--
I'm not really here - it's just your warped imagination.
"Salvatore Dolce" <sas...@tin.it> wrote in message
news:394F1A97...@tin.it...

Eric Dolce

unread,
Jun 20, 2000, 3:00:00 AM6/20/00
to Andy Platt
Hi Andy,

Thanks for the quick answer.
Do you know the register's content for this six ??

Thanks again
Eric

Andy Platt

unread,
Jun 20, 2000, 3:00:00 AM6/20/00
to
I'm sorry but I don't understand your question? I should have said that I
was referring to SPARC for which the first six parameters are passed in
registers %o0-%o5. If the called routine uses the 'save' instruction to push
a stack frame, these become registers %i0-%i5. Other parameters are
generally passed on the stack although some compilers, such as gcc, may use
%g2 for a pointer to lexically enclosing local variables.

Andy.

--
I'm not really here - it's just your warped imagination.

"Eric Dolce" <edo...@cybercable.fr> wrote in message
news:394F790B...@cybercable.fr...

Tony Walton

unread,
Jun 20, 2000, 3:00:00 AM6/20/00
to
Eric Dolce wrote:

> Andy Platt wrote:

> > --
> > I'm not really here - it's just your warped imagination.
> > "Salvatore Dolce" <sas...@tin.it> wrote in message
> > news:394F1A97...@tin.it...
> > > Hi all,
> > >
> > > Can someone tell me the format of the pstack output. I know that in
> > > parenteshis there are the function parameters but sometimes the number
> > > of the parameters are not respected.
> > >

> > It just prints the first six registers since it has no clue to how many
> > parameters were actually passed. It doesn't look at the debug information.
>

> Hi Andy,
>
> Thanks for the quick answer.
> Do you know the register's content for this six ??


The register contents are what pstack is showing you.

--
Tony

Michael Shapiro

unread,
Jun 21, 2000, 3:00:00 AM6/21/00
to
In article <394F1A97...@tin.it>, Salvatore Dolce <sas...@tin.it> wrote:
>Hi all,
>
>Can someone tell me the format of the pstack output. I know that in
>parenteshis there are the function parameters but sometimes the number
>of the parameters are not respected.

$ pstack $$

+-- the PID the command name
v |
164447: ksh <--+
ff21ab70 waitid (7, 0, ffbef220, 7)
ff1d5048 _waitpid (7, ffbef320, 4, ffbef320, 227c0, 25994) + 60
00025994 job_wait (41800, 4, d, 47638, 2a43e, ff21ac78) + 1b0
00031f90 sh_exec (2, 2a43e, 0, 0, 41f50, 41b61) + d7c
0002935c ???????? (45720, 407e0, 407e0, 41f50, 41f54, 41f50)
00028b90 main (41fe0, ffbef8f4, 41d94, 41fdc, 41d80, 41f54) + 944
00016a0c _start (0, 0, 0, 0, 0, 0) + b8 <---+
|
^ ^ ^- arguments in hex offset of %pc from symbol
| |
| + the symbol nearest to %pc, or ???? if none
|
+-- the %pc as a hex value

On SPARC, six arguments (saved to the stack when a register window is dumped)
are printed. On x86, we disassemble the function and try to figure out how
many arguments it pushed on the stack.

-Mike

--
Mike Shapiro, Solaris Kernel Development.

0 new messages