This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [gdbserver] Problems trying to resume dead threads
On Mon, Aug 04, 2008 at 09:45:46PM +0200, Ulrich Weigand wrote:
> It seems the "read" errors are just artifacts: because of the first
> error (on writing the register), the "error" call performs a longjmp
> to the toplevel, which leaves things in a somewhat strange state.
>
> The only "real" errors I see (in addition to the one in
> linux_resume_one_process) are the cases in regsets_store_inferior_registers
> (which is already a warning) and usr_store_inferior_registers (which
> is not).
>
> In any case, I don't think these should be even warnings for ESRCH:
> showing a warning in a situation that is completely normal and in
> fact handled correctly would just confuse users IMO.
>
> I'd propose to just silently ignore ESRCH errors while writing registers
> (in addition to your patch). What do you think?
I think that's acceptable, though not ideal. ESRCH can mean "the
program is gone", or for ptrace it can mean "the program is not
stopped". So there are a class of bugs in gdbserver which can lead to
the ESRCH error path. But distinguishing them from this case is quite
difficult.
--
Daniel Jacobowitz
CodeSourcery