This is the mail archive of the
mailing list for the Archer project.
Re: gdbstub initial code, v7
- From: Oleg Nesterov <oleg at redhat dot com>
- To: Roland McGrath <roland at redhat dot com>
- Cc: utrace-devel at redhat dot com, archer at sourceware dot org
- Date: Fri, 15 Oct 2010 16:28:15 +0200
- Subject: Re: gdbstub initial code, v7
- References: <20100830192040.GA15431@host1.dyn.jankratochvil.net> <20100831072048.GA26362@host1.dyn.jankratochvil.net> <20100902200632.GA23692@redhat.com> <20100903064008.GA16249@host1.dyn.jankratochvil.net> <20100903230957.GC8917@redhat.com> <20100910101452.39015405D5@magilla.sf.frob.com> <20100910182903.GB27699@redhat.com> <20100910190547.85CBD405D5@magilla.sf.frob.com> <20100910192001.GA30490@redhat.com> <20101013072346.1F239401B2@magilla.sf.frob.com>
On 10/13, Roland McGrath wrote:
> > On 09/10, Roland McGrath wrote:
> > >
> > > > ugdb sets "please stop" flag and does utrace_control(INTERRUPT). However,
> > > > in unlikely case the tracee can stop before ->report_signal() reporting
> > >
> > > I don't think this is the right thing to do. When the intent is explicitly
> > > to interrupt, there is no reason to stop before the interruption is
> > > complete, i.e. report_signal.
> > This means that ugdb_report_quiesce() should never return UTRACE_STOP,
> > and that is all.
> I'm not sure about this.
Ignoring the problems below, why?
> > But what about multitracing? Suppose that "(gdb) interrupt" happens
> > just before, say, do_report_syscall_entry() and another engine wants
> > to stop. If ugdb_report_quiesce() doesn't return UTRACE_STOP, then
> > gdb will wait until another debugger resumes the tracee.
> Yes, I do think that's a problem. We want gdb to report back promptly.
> One possibility is to have report_quiesce notice its argument is
> UTRACE_EVENT(SYSCALL_ENTRY) and roll back to before the syscall.
> That is, it enables SYSCALL_ENTRY and SYSCALL_EXIT reporting, then
> its report_syscall_entry uses UTRACE_SIGNAL_ABORT, report_syscall_exit
> does syscall_set_return_value(-ERESTARTNOHAND, 0) and then returns
> UTRACE_INTERRUPT. Now, we'll reenter a UTRACE_SIGNAL_REPORT callback
> "before" the system call, and we can stop there without being in any
> sticky situation.
Well, but this doesn't look friendly to other engines...
And at first glance this looks a bit too hairy. And, this doesn't
cover another case: gdb asks to stop the tracee when it is already
stopped by another engine and sleeps in utrace_resume() path.
So, I think ugdb should be changed so that "signal SIG" always works
(without reporing this signal) even when the stopped tracee doesn't
have the signal context.
As for $_siginfo (qXfer:siginfo:read::), I do not know what ugdb
should do. Probably it can just report the all-zeroes siginfo or
report si_signo = SIGSTOP.