From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12542 invoked by alias); 31 Jan 2013 06:35:38 -0000 Received: (qmail 12399 invoked by uid 22791); 31 Jan 2013 06:35:37 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 Jan 2013 06:35:30 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0V6ZR6H019679 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 31 Jan 2013 01:35:27 -0500 Received: from host2.jankratochvil.net (ovpn-116-88.ams2.redhat.com [10.36.116.88]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0V6ZINa007245 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 31 Jan 2013 01:35:21 -0500 Date: Thu, 31 Jan 2013 06:35:00 -0000 From: Jan Kratochvil To: Aleksandar Ristovski Cc: "gdb-patches@sourceware.org" Subject: Re: [patch] validate binary before use Message-ID: <20130131063518.GA3027@host2.jankratochvil.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5107F591.304@qnx.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2013-01/txt/msg00745.txt.bz2 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, "", 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. Thanks, Jan