This is the mail archive of the
mailing list for the GDB project.
Re: GDB loses running state of inferior
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Andreas Schwab <schwab at suse dot de>
- Date: Thu, 20 Nov 2008 15:18:44 +0000
- Subject: Re: GDB loses running state of inferior
- References: <firstname.lastname@example.org>
On Thursday 20 November 2008 14:33:14, Andreas Schwab wrote:
> When an error occurs during startup of the child the running state of
> the child is lost and gdb is refusing to continue it:
> (gdb) c
> Cannot execute this command while the selected thread is running.
> 2008-11-20 Andreas Schwab <email@example.com>
> * fork-child.c (startup_inferior): Don't lose running state of
Thanks. Could you hold on to this a bit? This will make it so that
MI outputs more *running, *stopped notifications when going through
the shell on startup.
This a problem that can happen in several other places, and I've
been solving them with a cleanup and a new function that sets
the threads' running state (tp->state_) from the tp->executing_ property.
I'll have to clean it up a bit to submit, then we can fix this too.
> --- gdb/fork-child.c.~1.47.~ 2008-11-10 11:25:09.000000000 +0100
> +++ gdb/fork-child.c 2008-11-20 14:27:26.000000000 +0100
> @@ -494,6 +494,9 @@ startup_inferior (int ntraps)
> resume_ptid = pid_to_ptid (-1);
> resume_ptid = event_ptid;
> + /* Update running state now, in case an error occurs during
> + resume. */
> + set_running (resume_ptid, 0);
> if (resume_signal != TARGET_SIGNAL_TRAP)