This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stack_used() not accurate?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]