stack_used() not accurate?

Masami Hiramatsu mhiramat@redhat.com
Tue Jun 3 23:34:00 GMT 2008


Hi Jim,

Jim Keniston wrote:
> Sorry, I haven't been following this thread for a while, so maybe this
> has already been mentioned.  But keep in mind that on i386, when your
> breakpoint trap happens in kernel code, esp and ss aren't saved on the
> stack.  So regs->esp and regs->ss contain the top of the pre-trap stack,
> and the pre-trap stack pointer is &regs->esp, not regs->esp.

That's right. However, if so, REG_SP(CONTEXT->regs) on x86 should
return &CONTEXT->regs->esp, because the macro means "return the value
of the stack pointer register". (and it must be prohibited to set
a value to SP on x86; it must break the content on the top of stack)

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com



More information about the Systemtap mailing list