This is the mail archive of the systemtap@sources.redhat.com 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: design: function-exit probes


On Mon, 2005-02-14 at 10:11, Frank Ch. Eigler wrote:
> Hi -
> 
> On Mon, Feb 14, 2005 at 09:01:38AM -0800, Jim Keniston wrote:
> > Here's my design for function-exit probes [...]
> 
> Looks really good.
> 
> One tricky issue will be the setting of the pt_regs at the return
> handler.  Ideally, pt_regs should contain state that corresponds to
> a hypothetical breakpoint in one of two points: (a) at the actual
> return instruction in the callee; or (b) the instruction after the
> call in the caller.  That way, accessing local variables in one or
> the other scope would be possible.  
> 
> In the case of the trampoline breakpoint, at least the PC value
> will point elsewhere.  If the SP/FP registers are as they would
> be in one or the other scenario, that should be good enough.

Correct.  The PC will be pointing to the trampoline, but the other
registers will reflect the expected state of affairs after the ret
instruction has been executed.  The return address is available in
the rprobe_instance object passed to the user's handler, so I don't
think we need to temporarily patch the correct PC into the pt_regs.
I could be convinced otherwise.

Jim

> - FChE


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