From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24857 invoked by alias); 13 Jan 2010 09:25:55 -0000 Received: (qmail 24811 invoked by uid 22791); 13 Jan 2010 09:25:54 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Jan 2010 09:25:50 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id B6985CB0238 for ; Wed, 13 Jan 2010 10:25:48 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KVcAEZ9nb0qD for ; Wed, 13 Jan 2010 10:25:48 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id A47CDCB0237 for ; Wed, 13 Jan 2010 10:25:48 +0100 (CET) From: Tristan Gingold Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: [RFA] windows: do not crash if inferior Date: Wed, 13 Jan 2010 09:25:00 -0000 Message-Id: <1C9A707A-AE7C-4947-A9DA-F105674F81AE@adacore.com> To: gdb-patches ml Mime-Version: 1.0 (Apple Message framework v1077) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-01/txt/msg00332.txt.bz2 Hi, in case of early exit of the inferior, gdb crashes due to an assertion fail= ure in inferior_thread(). This can happen if the inferior is not able to load a DLL due to a permissi= on issue. I am not sure that this is the best fix, but at least it avoids the crash. Tristan. 2010-01-13 gingold * windows-nat.c (do_initial_windows_stuff): Call error() if the inferior doesn't exist anymore. diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index f91ca32..29a28a9 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1603,6 +1603,11 @@ do_initial_windows_stuff (struct target_ops *ops, DW= ORD p { stop_after_trap =3D 1; wait_for_inferior (0); + + /* The inferior may have exited early, due to eg. a DLL load error. = */ + if (ptid_equal (inferior_ptid, null_ptid)) + error (_("inferior exited early")); + tp =3D inferior_thread (); if (tp->stop_signal !=3D TARGET_SIGNAL_TRAP) resume (0, tp->stop_signal);