From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23084 invoked by alias); 28 Dec 2011 06:02:30 -0000 Received: (qmail 23075 invoked by uid 22791); 28 Dec 2011 06:02:27 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Dec 2011 06:02:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 8D6B62BB2A9; Wed, 28 Dec 2011 01:02:13 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DjDl2sUCdJYH; Wed, 28 Dec 2011 01:02:13 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id EE6452BB2A8; Wed, 28 Dec 2011 01:02:12 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 046E0145615; Tue, 27 Dec 2011 22:02:01 -0800 (PST) Date: Wed, 28 Dec 2011 07:07:00 -0000 From: Joel Brobecker To: Mark Kettenis Cc: emachado@linux.vnet.ibm.com, gdb-patches@sourceware.org Subject: Re: [RFA] Ignore data minimal symbols for breakpoint linespecs Message-ID: <20111228060200.GL23376@adacore.com> References: <1324548943-26819-1-git-send-email-brobecker@adacore.com> <20111227041110.GA23376@adacore.com> <4EF9F1A1.2090302@linux.vnet.ibm.com> <20111227164837.GI23376@adacore.com> <201112271708.pBRH8K1X019780@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="YToU2i3Vx8H2dn7O" Content-Disposition: inline In-Reply-To: <201112271708.pBRH8K1X019780@glazunov.sibelius.xs4all.nl> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2011-12/txt/msg00863.txt.bz2 --YToU2i3Vx8H2dn7O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 378 > Give that the target in question is 64-bit PowerPC, my bet is that by > discarding data minimal symbols, you're also discarding function > descriptors. That's probably not a good idea. Thanks for the tip, Mark. After having looked at the logs, I think you are right on the money. What do you think of the attached patch? Edjunior, can you test it for me? Thanks, -- Joel --YToU2i3Vx8H2dn7O Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-linespec-keep-function-descriptors-during-minimal-sy.patch" Content-length: 1296 >From af87a92e11cf40dc2f2fcc358cf405e3cb2905ec Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Wed, 28 Dec 2011 09:35:35 +0400 Subject: [PATCH] linespec: keep function descriptors during minimal symbol search When discarding data (minimal) symbols, we need to be careful to not throw away the function descriptors. This makes a different on platforms where these descriptors are used and live in a data section. gdb/ChangeLog: * linespec.c (add_minsym): Preserve function descriptors. --- gdb/linespec.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/gdb/linespec.c b/gdb/linespec.c index 9d753e5..1266418 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -2812,7 +2812,17 @@ add_minsym (struct minimal_symbol *minsym, void *d) case mst_abs: case mst_file_data: case mst_file_bss: - return; + { + /* Make sure this minsym is not a function descriptor + before we decide to discard it. */ + struct gdbarch *gdbarch = info->objfile->gdbarch; + CORE_ADDR addr = gdbarch_convert_from_func_ptr_addr + (gdbarch, SYMBOL_VALUE_ADDRESS (minsym), + ¤t_target); + + if (addr == SYMBOL_VALUE_ADDRESS (minsym)) + return; + } } mo.minsym = minsym; -- 1.7.1 --YToU2i3Vx8H2dn7O--