From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10309 invoked by alias); 3 Jul 2008 10:17:59 -0000 Received: (qmail 10299 invoked by uid 22791); 3 Jul 2008 10:17:58 -0000 X-Spam-Check-By: sourceware.org Received: from mms2.broadcom.com (HELO mms2.broadcom.com) (216.31.210.18) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 03 Jul 2008 10:17:40 +0000 Received: from [10.11.16.99] by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Thu, 03 Jul 2008 03:17:24 -0700 X-Server-Uuid: D3C04415-6FA8-4F2C-93C1-920E106A2031 Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id 143262B1; Thu, 3 Jul 2008 03:17:24 -0700 (PDT) Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.11.18.52]) by mail-irva-10.broadcom.com (Postfix) with ESMTP id F27BF2B0; Thu, 3 Jul 2008 03:17:23 -0700 (PDT) Received: from mail-irva-13.broadcom.com (mail-irva-13.broadcom.com [10.11.16.103]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP id GZF69238; Thu, 3 Jul 2008 03:17:23 -0700 (PDT) Received: from NT-IRVA-0752.brcm.ad.broadcom.com (nt-irva-0752 [10.8.194.67]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 5317274CFF; Thu, 3 Jul 2008 03:17:23 -0700 (PDT) Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: Bug handling zero sized symbols in minsyms.c Date: Thu, 03 Jul 2008 10:17:00 -0000 Message-ID: In-Reply-To: <1215020690.3601.1592.camel@localhost.localdomain> References: <1215020690.3601.1592.camel@localhost.localdomain> From: "Robert Norton" To: "Michael Snyder" cc: gdb@sourceware.org X-WSS-ID: 647278BE3D076636447-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00022.txt.bz2 > -----Original Message----- > From: Michael Snyder [mailto:msnyder@specifix.com]=20 > Sent: 02 July 2008 18:45 > To: Robert Norton > Cc: gdb@sourceware.org > Subject: Re: Bug handling zero sized symbols in minsyms.c >=20 > On Wed, 2008-07-02 at 09:58 -0700, Robert Norton wrote: > > Hi, > >=20 > > In minsyms.c:lookup_minimal_symbol_by_pc_section() there is=20 > some code > > which attempts to prefer symbols with sizes over those with=20 > zero size. > > This is quite useful[1]. Unfortunately the present code=20 > will only work > > if there is at most one zero-sized symbol. The fix is=20 > around line 503: > >=20 > > if (MSYMBOL_SIZE (&msymbol[hi]) =3D=3D 0 > > && best_zero_sized =3D=3D -1) > > { > > best_zero_sized =3D hi; > > hi--;=20=20=20=20=20=20=20=20=20=20 > > continue;=20=20=20=20=20=20 > > } > >=20 > > SHOULD be: > >=20 > > if (MSYMBOL_SIZE (&msymbol[hi]) =3D=3D 0) > > { > > if (best_zero_sized =3D=3D -1) > > best_zero_sized =3D hi; > > hi--; > > continue; > > } > >=20 > > We keep the highest zero-sized symbol as the best but continue to > > iterate backwards until we hit a non-zero-sized symbol or run out of > > symbols. It's pretty clear that this is what was originally=20 > intended. >=20 > Your change is good, thanks. >=20 > > I can get copyright assigment for this if required although it seems > > pretty trivial... >=20 > Not necessary, but feel free to if you'd like. > I think this is at least the second change you've submitted. It turns out that we (Broadcom) already have one on file, so no problems there. > Could you give us a change log entry please? How about: 2008-07-03 Robert Norton (rnorton@broadcom.com) * minsyms.c: Fix a bug with ignoring zero-sized symbols when looking up the minsym for a PC. Cheers, Robert