From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22922 invoked by alias); 31 Dec 2009 07:03:08 -0000 Received: (qmail 22913 invoked by uid 22791); 31 Dec 2009 07:03:07 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 Dec 2009 07:02:58 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 988F22BAB90 for ; Thu, 31 Dec 2009 02:02:56 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id i77gbpNv7ACL for ; Thu, 31 Dec 2009 02:02:56 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E4B922BAABD for ; Thu, 31 Dec 2009 02:02:55 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 84659F5937; Thu, 31 Dec 2009 08:02:24 +0100 (CET) Date: Thu, 31 Dec 2009 07:03:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA/commit] Internal error while loading core on alpha-tru64 Message-ID: <20091231070224.GE548@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="da4uJneut+ArUgXk" Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2009-12/txt/msg00459.txt.bz2 --da4uJneut+ArUgXk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1884 Hello, There is an internal-error due to GDB not being able to find the inferior address space when trying to load a core file on alpha-tru64. The core file is for a program that does not use threads. The name of the section where the registers is saved is .reg. core_open prefers .reg/NN rather than .reg, and has some special code to handle the case where no .reg/NN section was found. /* Either we found no .reg/NN section, and hence we have a non-threaded core (single-threaded, from gdb's perspective), or for some reason add_to_thread_list couldn't determine which was the "main" thread. The latter case shouldn't usually happen, but we're dealing with input here, which can always be broken in different ways. */ struct thread_info *thread = first_thread_of_process (-1); if (thread == NULL) { add_inferior_silent (CORELOW_PID); inferior_ptid = pid_to_ptid (CORELOW_PID); add_thread_silent (inferior_ptid); } The problem is that the code above is it is using add_inferior_silent. As a result, we end up with a second inferior in our list (which I do not think is expected), and also this new inferior has no program or address space. The fix I applied was to replace the call to add_inferior_silent by a call to inferior_appeared... I think that this was the right thing to do. 2009-12-31 Joel Brobecker Internal error while loading core on alpha-tru64. * corelow.c (core_open): Delete unused local variables. Use inferior_appeared instead of add_inferior_silent. Tested on alpha-tru64 with the AdaCore gdb-testsuite (I can no longer run the dejagnu testsuite on this platform). This is the only platform where I observed this issue. Will commit in a few days unless there are any objections. -- Joel --da4uJneut+ArUgXk Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="corelow.diff" Content-length: 1037 commit da99585b71b9646f9468e1f6aff00c9fcd18202b Author: brobecke Date: Thu Dec 31 06:25:05 2009 +0000 Internal error while loading core on alpha-tru64. * corelow.c (core_open): Delete unused local variables. Use inferior_appeared instead of add_inferior_silent. diff --git a/gdb/corelow.c b/gdb/corelow.c index d0eada6..15ecd2d 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -302,8 +302,6 @@ core_open (char *filename, int from_tty) bfd *temp_bfd; int scratch_chan; int flags; - int corelow_pid = CORELOW_PID; - struct inferior *inf; target_preopen (from_tty); if (!filename) @@ -423,7 +421,7 @@ core_open (char *filename, int from_tty) struct thread_info *thread = first_thread_of_process (-1); if (thread == NULL) { - add_inferior_silent (CORELOW_PID); + inferior_appeared (current_inferior (), CORELOW_PID); inferior_ptid = pid_to_ptid (CORELOW_PID); add_thread_silent (inferior_ptid); } --da4uJneut+ArUgXk--