From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28370 invoked by alias); 20 May 2007 15:50:15 -0000 Received: (qmail 28329 invoked by uid 22791); 20 May 2007 15:50:14 -0000 X-Spam-Check-By: sourceware.org Received: from ug-out-1314.google.com (HELO ug-out-1314.google.com) (66.249.92.174) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 20 May 2007 15:50:01 +0000 Received: by ug-out-1314.google.com with SMTP id 75so760702ugb for ; Sun, 20 May 2007 08:49:57 -0700 (PDT) Received: by 10.66.243.2 with SMTP id q2mr2726403ugh.1179676196363; Sun, 20 May 2007 08:49:56 -0700 (PDT) Received: from ?88.210.123.158? ( [88.210.123.158]) by mx.google.com with ESMTP id k1sm5986057ugf.2007.05.20.08.49.49; Sun, 20 May 2007 08:49:51 -0700 (PDT) Message-ID: <46506E03.2090603@portugalmail.pt> Date: Sun, 20 May 2007 15:50:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.4.0 MIME-Version: 1.0 To: Ulrich Weigand CC: Joel Brobecker , gdb-patches@sourceware.org Subject: Re: [commit/AIX] Fix error when loading core file References: <200705201511.l4KFBlYB015777@d12av02.megacenter.de.ibm.com> In-Reply-To: <200705201511.l4KFBlYB015777@d12av02.megacenter.de.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2007-05/txt/msg00323.txt.bz2 Ulrich Weigand wrote: > Joel Brobecker wrote: > >> 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. > > Yes, if you look at the SOLIB_ADD definition: > > #define SOLIB_ADD(a, b, c, d) \ > if (PIDGET (inferior_ptid)) \ > /* Attach to process. */ \ > xcoff_relocate_symtab (PIDGET (inferior_ptid)); \ > else \ > /* Core file. */ \ > xcoff_relocate_core (c); > > it is clear that the _symtab version is intended to be called only > in the case of live process. > > It looks like something changed to get SOLIB_CREATE_INFERIOR_HOOK > now invoked as well ... > > >> 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. > > Yes, I noticed that as well. I had already started to do that, but > got side-tracked by other stuff in the meantime. One problem is that > the ldinfo ptrace call that is required to get at the list of loaded > shared libraries is really a native-only call. > > I'd thought of defining a TARGET_OBJECT_LDINFO xfer_partial object > that reflects the contents of the ldinfo, and use this in the > implementation of a (platform-independent) solib-aix.c file. > The rs6000 native target and the core file support would need to > be extended to supply that object. > If AIX needs to use native calls to get at the shared libraries list, perhaps you could also look if the solib-target.c Daniel is pushing for remote dll support, and see if it would be a good fit for AIX too. As a quick look it seems so. You would move aix_current_sos to the target_ops, and perhaps needs a few other tweaks (aix_in_dynsym_resolve_code, and aix_solib_create_inferior_hook). Although he presented it as remote support, it also makes sense for native win32 debugging, so it may also make sense as native AIX debugging. You would need these applied: http://sourceware.org/ml/gdb-patches/2007-05/msg00140.html http://sourceware.org/ml/gdb-patches/2007-05/msg00145.html Cheers, Pedro Alves