Re: [patch/rfc] Use frame_type for sigtramp test in infrun.c

Andrew Cagney
2004-03-21T22:38:32Z

> Hello,
>
> The attached patch modifies infrun.c so that, for the non-legacy case, the test:
> frame_type == SIGTRAMP frame
> && step_frame_id != stop_frame_id
> is used to determine if a single-step caused the inferior to stumble into a signal trampoline (either via a signal, or by returning from the handler). This replaces two pc_in_sigtramp calls and a stack-pointer heuristic -- not the most robust of tests.
>
> The new test:
>
> - eliminates the call pc_in_sigtramp(step_pc)
> (i.e., on the PC from before the single step) (this was an unexpected bonus :-)
>
> - uses the caching call get_frame_type call
> pc_in_sigtramp has to re-do all the computation each time it is called (typically duplicating the effort of get_frame_type)
>
> - uses !frame_id_eq
> Which is a 100% robust frame-changed test. The old test couldn't detect a signal trampoline calling (via a signal) a singnal trampoline.
>
> thoughts?
>
> I'll look to commit this in a few days (already committed to my trad-frame branch).

I've checked this in.

Andrew

> 2004-03-16 Andrew Cagney <cagney@redhat.com>
>
> * infrun.c (handle_inferior_event): For non legacy frames, use the
> frame ID and frame type to identify a signal trampoline. Update
> comments.