Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFC: fix crash when inferior exits during "continue"
Date: Fri, 10 Feb 2012 14:41:00 -0000	[thread overview]
Message-ID: <20120210144040.GA28038@host2.jankratochvil.net> (raw)
In-Reply-To: <m3y5seihhp.fsf@fleche.redhat.com>

On Tue, 07 Feb 2012 20:13:54 +0100, Tom Tromey wrote:
> Built and regtested on x86-64 Fedora 15.

It does crash for me on F-15 but it does not crash on either F-16 or F-17.


> b/gdb/ChangeLog:

Missing testsuite/ ChangeLog.


> --- /dev/null
> +++ b/gdb/testsuite/gdb.base/inferior-died.exp
> @@ -0,0 +1,56 @@
> +# Copyright 2012 Free Software Foundation, Inc.
> +
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +
> +if { [is_remote target] || ![isnative] } then {

"isnative" is excessive"; but linux-nat cannot be cross-target anyway.

> +    unsupported "inferior-died.exp"
> +    continue
> +}
> +
> +# Until "set follow-fork-mode" and "catch fork" are implemented on
> +# other targets...
> +#
> +if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-*-linux*"]} then {
> +    unsupported "inferior-died.exp"
> +    continue
> +}
> +
> +if { ![support_displaced_stepping] } {
> +    unsupported "inferior-died.exp"
> +    return -1
> +}
> +
[...]
> --- a/gdb/thread.c
> +++ b/gdb/thread.c
[...]
> @@ -1091,8 +1101,15 @@ do_restore_current_thread_cleanup (void *arg)
>      restore_current_thread (old->inferior_ptid);
>    else
>      {
> +      struct inferior *inf = find_inferior_id (old->inf_id);
> +
>        restore_current_thread (null_ptid);
> -      set_current_inferior (find_inferior_id (old->inf_id));
> +
> +      /* If the inferior was deleted, choose some other inferior.  */

Maybe during make_cleanup_restore_current_thread temporarily remember + clear
inferior->removable instead.


> +      if (inf == NULL)
> +	inf = iterate_over_inferiors (choose_first_inferior, NULL);
> +
> +      set_current_inferior (inf);
>      }
>  
>    /* The running state of the originally selected thread may have


Thanks,
Jan


  reply	other threads:[~2012-02-10 14:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-07 19:14 Tom Tromey
2012-02-10 14:41 ` Jan Kratochvil [this message]
2012-02-10 20:05   ` Tom Tromey
2012-02-14 13:44     ` Gary Benson
2012-02-14 14:19       ` Pedro Alves
2012-02-15 22:24         ` Tom Tromey
2012-02-16 12:45           ` Pedro Alves
2012-02-16 14:42             ` Tom Tromey
2012-02-16 15:24               ` Tom Tromey
2012-02-20  2:41           ` [patch] testsuite: Fix inferior-died.exp racy FAILs [Re: RFC: fix crash when inferior exits during "continue"] Jan Kratochvil
2012-02-20 21:05             ` [commit] " Jan Kratochvil
2012-02-20 21:24             ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120210144040.GA28038@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox