This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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]

Stepping through signal trampolines


The recent changes to the signal trampoline stuff have changed the way
we deal with stepping through signal trampolines.  I did some
experimenting with an older GDB and noticed the following differences:

* Finish from within a signal handler now makes us end up in the
  signal trampoline now, whereas an older GDB simply ran until exit.
  I guess this is a good thing.

* Stepping out of the signal handler using "stepi" makes us run until
  exit now, whereas an older GDB happily continues stepping into the
  signal trampoline.

* If I use finish to get into the signal trampoline with a current
  GDB, stepi continues until we return from the signal trampoline.
  Using stepi on the older GDB from within the signal trampoline
  happily steps through the signal trampoline.

So there still seem to be some quirks with stepping through signal
trampolines.  But before we decide what's the bug, I think we should
ask ourselves what the desired behaviour is.  In my view:

* "finish" from within a signal handler should make us return to the
  signal trampoline.

* "finish" from within a signal trampoline should make us return to
  the point where the signal interruption occured.

* "stepi" from within a signal handler should step through the signal
  handler and back into the signal trampoline.

* "stepi" from within a signal trampoline should step through the
  signal trampoline until the sigreturn system call.

I'm not sure what "next" and "step" should do exactly.  Here we must
distinguish between systems with libc-provided signal trampolines and
systems with kernel-provided signal trampolines.  For the latter we
usually won't have debug info, so "next" and "step" should probably
skip them.  For the former, we probably want to make them stop at
lines within the signal trampoline if we have debug info for those
lines.

Thoughts?

Mark


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