From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32078 invoked by alias); 31 Jan 2013 14:24:56 -0000 Received: (qmail 32068 invoked by uid 22791); 31 Jan 2013 14:24:55 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from na3sys009aog107.obsmtp.com (HELO na3sys009aog107.obsmtp.com) (74.125.149.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 Jan 2013 14:24:50 +0000 Received: from mx10.qnx.com ([209.226.137.110]) (using TLSv1) by na3sys009aob107.postini.com ([74.125.148.12]) with SMTP ID DSNKUQp+savKawzkAs8pb8dFmOqmPrpO/qSC@postini.com; Thu, 31 Jan 2013 06:24:50 PST Received: by mx10.qnx.com (Postfix, from userid 500) id 10F0020E05; Thu, 31 Jan 2013 09:24:49 -0500 (EST) Received: from exhts.ott.qnx.com (exch2 [10.222.2.136]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx10.qnx.com (Postfix) with ESMTPS id E356420ACE; Thu, 31 Jan 2013 09:24:48 -0500 (EST) Received: from [10.222.96.215] (10.222.2.5) by exch2.ott.qnx.com (10.222.2.136) with Microsoft SMTP Server id 14.2.318.4; Thu, 31 Jan 2013 09:24:48 -0500 Message-ID: <510A7EB0.90702@qnx.com> Date: Thu, 31 Jan 2013 14:24:00 -0000 From: Aleksandar Ristovski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 Newsgroups: gmane.comp.gdb.patches To: Jan Kratochvil CC: "gdb-patches@sourceware.org" Subject: Re: [patch] validate binary before use References: <50D4C49A.6040502@qnx.com> <50D8B37A.20001@qnx.com> <20121225073709.GA11349@host2.jankratochvil.net> <50DCAA5C.3000301@qnx.com> <20121227205924.GA5109@host2.jankratochvil.net> <50DCB787.6020601@qnx.com> <20121227211328.GA5739@host2.jankratochvil.net> <50DCBBD1.7000707@qnx.com> <5107F591.304@qnx.com> <20130131063518.GA3027@host2.jankratochvil.net> In-Reply-To: <20130131063518.GA3027@host2.jankratochvil.net> 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: 2013-01/txt/msg00748.txt.bz2 On 13-01-31 01:35 AM, Jan Kratochvil wrote: > On Tue, 29 Jan 2013 17:15:13 +0100, Aleksandar Ristovski wrote: >> --- gdb/solib.c 1 Jan 2013 06:32:51 -0000 1.169 >> +++ gdb/solib.c 29 Jan 2013 15:46:39 -0000 >> @@ -495,6 +495,17 @@ solib_map_sections (struct so_list *so) >> } >> } >> >> + gdb_assert (ops->validate != NULL); >> + >> + if (!ops->validate (so)) > > When thinking about it this approach regresses back again performance with > gdbserver over high latency links. This is why the XML > protocol has been put there. With ops->validate there will be > a round-trip-time requirement on very every library listed from gdbserver. > > Therefore with gdbserver the current > p += sprintf (p, " "l_addr=\"0x%lx\" l_ld=\"0x%lx\"/>", > should be extended with hex-encoded build-id="..." parameter. gdbserver does > not have the bfd but it already iterates program headers in get_dynamic so it > can find PT_NOTE there. > > Therefore there should be new build_id field in struct so_list where > svr4_current_sos_via_xfer_libraries will put it from gdbserver. In local mode > it should remain mostly as you wrote it / as suggested in the review as there > is currently no easy non-Linux way how to find PT_NOTE without bfd at hand. > > Ok, I can add this. Will be included in the new patch. Thanks, Aleksandar