From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1966 invoked by alias); 11 Jun 2009 13:39:39 -0000 Received: (qmail 1956 invoked by uid 22791); 11 Jun 2009 13:39:39 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Jun 2009 13:39:32 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MEkV8-0007Hb-3r for gdb-patches@sources.redhat.com; Thu, 11 Jun 2009 13:39:30 +0000 Received: from entropy.qnx.com ([209.226.137.107]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Jun 2009 13:39:30 +0000 Received: from aristovski by entropy.qnx.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Jun 2009 13:39:30 +0000 To: gdb-patches@sources.redhat.com From: Aleksandar Ristovski Subject: Re: [patch] solib-svr4.c - allow reading linkmap info from core without executable Date: Thu, 11 Jun 2009 13:39:00 -0000 Message-ID: <4A310906.4030603@qnx.com> References: <200906102308.29638.pedro@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Pedro Alves User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: <200906102308.29638.pedro@codesourcery.com> 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: 2009-06/txt/msg00295.txt.bz2 Pedro Alves wrote: >> if (info->debug_base == 0 && svr4_have_link_map_offsets ()) >> { >> - if (exec_bfd != NULL >> + if ((exec_bfd != NULL >> && bfd_get_flavour (exec_bfd) == bfd_target_elf_flavour) >> + || (core_bfd != NULL >> + && bfd_get_flavour (core_bfd) == bfd_target_elf_flavour)) >> info->debug_base = elf_locate_base (); >> } > > Are there live debugging cases (archs?, PIE?) (e.g., "target remote" > without specifying an executable) where letting elf_locate_base > try to read the debug base from the target's auxv (scan_dyntag_auxv) > will work? It would mean that removing the exec_bfd checks instead > of adding core_bfd checks, would still improve your case, while > letting other cases benefit as well. > Yes, in theory it should work as long as target_ops in question know how to read auxv (that is, as long as to_xfer_partial(ops, TARGET_OBJECT_AUXV,...) knows how to do it.) I had internally made this change: { - if (exec_bfd != NULL + if ((exec_bfd != NULL && bfd_get_flavour (exec_bfd) == bfd_target_elf_flavour) + || exec_bfd == NULL) debug_base = elf_locate_base (); } return (debug_base); But wanted to be more conservative for FSF, since I do not quite understand under which circumstances could we end up in solib-svr4, and not have "bfd_target_elf_flavour". Thanks, -- Aleksandar Ristovski QNX Software Systems