From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6295 invoked by alias); 20 May 2007 00:01:28 -0000 Received: (qmail 6285 invoked by uid 22791); 20 May 2007 00:01:27 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 20 May 2007 00:01:25 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id 8D37248CBE0 for ; Sat, 19 May 2007 20:01:19 -0400 (EDT) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11182-01-2 for ; Sat, 19 May 2007 20:01:19 -0400 (EDT) Received: from joel.gnat.com (unknown [70.71.0.212]) by nile.gnat.com (Postfix) with ESMTP id EB13348CBB8 for ; Sat, 19 May 2007 20:01:18 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 5708DE7B4F; Sat, 19 May 2007 17:01:54 -0700 (PDT) Date: Sun, 20 May 2007 00:01:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [commit/AIX] Fix error when loading core file Message-ID: <20070520000154.GW3565@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="h31gzZEtNLTqOjlF" Content-Disposition: inline User-Agent: Mutt/1.4.2.2i 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: 2007-05/txt/msg00318.txt.bz2 --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1259 Hello, We noticed the following problem with gdb-6.6 when trying to load a core file on AIX: (gdb) core core ptrace ldinfo: No such process. This is the cause of 2 FAILS in corefile.exp. I think the problem started when we introduced post_create_inferior. This causes us to call the SOLIB_CREATE_INFERIOR_HOOK, which in our case is defined as a call to xcoff_relocate_symtab. I haven't really checked with older versions of GDB because rebuilding GDB on AIX is mighty slow, but it very much looks like this function was not called in the case of core files before. This function is assuming a live process, not a core file. So what I did was do an early return when debugging a core file. What this made me realize, however, is that we should really be converting the AIX port to using the target_so_ops. I'll try to do that soon. In the meantime, the attached patch should be good enough. 2007-05-19 Joel Brobecker * rs6000-nat.c (xcoff_relocate_symtab): Do nothing if debugging a core file. Add comment in the function description. Tested on ppc-aix, fixes: gdb.base/corefile.exp: args: execfile -core=corefile gdb.base/corefile.exp: core-file command Committed. -- Joel --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="aix-core.diff" Content-length: 856 Index: rs6000-nat.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-nat.c,v retrieving revision 1.70 diff -u -p -r1.70 rs6000-nat.c --- rs6000-nat.c 11 May 2007 19:55:20 -0000 1.70 +++ rs6000-nat.c 18 May 2007 22:17:46 -0000 @@ -1016,7 +1016,9 @@ rs6000_create_inferior (char *exec_file, /* xcoff_relocate_symtab - hook for symbol table relocation. - also reads shared libraries. */ + + This is only applicable to live processes, and is a no-op when + debugging a core file. */ void xcoff_relocate_symtab (unsigned int pid) @@ -1028,6 +1030,9 @@ xcoff_relocate_symtab (unsigned int pid) int ldisize = arch64 ? sizeof (ldi->l64) : sizeof (ldi->l32); int size; + if (ptid_equal (inferior_ptid, null_ptid)) + return; + do { size = load_segs * ldisize; --h31gzZEtNLTqOjlF--