[PATCH] Don't skip over return trampolines when instruction-stepping
Maciej W. Rozycki
macro@codesourcery.com
Mon Feb 27 23:06:00 GMT 2012
On Wed, 7 Dec 2011, Doug Evans wrote:
> > Â I don't think "stepi" should ever execute more than one instruction
> > (special cases like branch delay slots excepted).
>
> Agreed.
>
> > However the return
> > trampoline code skips over such pieces in one go even in the
> > instruction-stepping mode.
> >
> > Â Here's a fix to address this problem. Â Unfortunately this hook is
> > currently only used by two platforms -- RS6000/AIX and PA-RISC/HP-UX --
> > both of which are too exotic for me to test, but the change should be
> > obvious anyway.
> >
> > Â The test suite doesn't really cover instruction-stepping (being too
> > architecture-specific for generic coverage), but this was noticed in
> > manual MIPS16 testing with one of the followup changes that uses the
> > return trampoline hook to handle MIPS16 return thunks.
> >
> > Â OK to apply?
> >
> > 2011-12-06  Maciej W. Rozycki  <macro@mips.com>
> >       Maciej W. Rozycki  <macro@codesourcery.com>
> >
> > Â Â Â Â gdb/
> > Â Â Â Â * infrun.c (handle_inferior_event): Don't proceed through
> > Â Â Â Â shared library trampolines if stepping at the machine
> > Â Â Â Â instruction level.
> >
> > Â Maciej
> >
> > gdb-return-trampoline-step.diff
> > Index: gdb-fsf-trunk-quilt/gdb/infrun.c
> > ===================================================================
> > --- gdb-fsf-trunk-quilt.orig/gdb/infrun.c    2011-11-08 11:25:58.635899589 +0000
> > +++ gdb-fsf-trunk-quilt/gdb/infrun.c   2011-11-08 11:26:07.545882458 +0000
> > @@ -5009,7 +5009,8 @@ handle_inferior_event (struct execution_
> > Â /* If we're in the return path from a shared library trampoline,
> > Â Â Â we want to proceed through the trampoline when stepping. Â */
> > Â if (gdbarch_in_solib_return_trampoline (gdbarch,
> > - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â stop_pc, ecs->stop_func_name))
> > + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â stop_pc, ecs->stop_func_name)
> > + Â Â Â && ecs->event_thread->control.step_over_calls != STEP_OVER_NONE)
> > Â Â {
> > Â Â Â /* Determine where this trampoline returns. Â */
> > Â Â Â CORE_ADDR real_stop_pc;
> >
>
> I think it's ok but I'd give it a few more days to see if I missed something.
Committed now, thanks for your review.
Maciej
More information about the Gdb-patches
mailing list