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]

PTRACE_SINGLESTEP into signal handler





Hello,

I'm seeing failures in the sigstep.exp test case on s390:
FAIL: gdb.base/sigstep.exp: step on breakpoint, to handler entry; performing step
FAIL: gdb.base/sigstep.exp: next on breakpoint, to handler entry; performing next
FAIL: gdb.base/sigstep.exp: continue on breakpoint, to handler entry; performing continue

The reason for this appears to be that they set a breakpoint on the
very first instruction of a signal handler that is being stepped into
via PTRACE_SINGLESTEP.  For some reason, while this is done, the
breakpoints are not actually inserted.

When the debugger next gets control, the first instruction of the
handler was already executed.  Thus, while it now does insert the
breakpoint instructions, it is too late ...

Does gdb assume PTRACE_SINGLESTEP into a handle returns *before*
the first instruction of the handler was executed?

We could change the kernel to do that, and this fixes the test case
failures, but I'm not sure if this is the right thing to do --
the ptrace documentation says "arranges for the child to be stopped
after execution of a single instruction", which would appear to
indicate the current behaviour is correct.

How does this work on other platforms?


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand
  Linux for S/390 Design & Development
  IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
  Phone: +49-7031/16-3727   ---   Email: Ulrich.Weigand@de.ibm.com


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