From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27812 invoked by alias); 18 Jun 2009 14:04:15 -0000 Received: (qmail 27562 invoked by uid 22791); 18 Jun 2009 14:04:14 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from qnxmail.qnx.com (HELO qnxmail.qnx.com) (209.226.137.76) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Jun 2009 14:04:07 +0000 Received: from Nebula.ott.qnx.com (nebula.ott.qnx.com [10.42.3.30]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id KAA20778; Thu, 18 Jun 2009 10:03:53 -0400 Received: from [127.0.0.1] ([10.42.100.129]) by Nebula.ott.qnx.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 18 Jun 2009 10:03:57 -0400 Message-ID: <4A3A4928.6010102@qnx.com> Date: Thu, 18 Jun 2009 14:04:00 -0000 From: Aleksandar Ristovski User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com CC: Pedro Alves Subject: Re: [patch] solib-svr4.c - allow reading linkmap info from core without executable References: <200906102308.29638.pedro@codesourcery.com> <4A310906.4030603@qnx.com> In-Reply-To: <4A310906.4030603@qnx.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00467.txt.bz2 Is this ok to commit? Aleksandar Ristovski wrote: > 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