From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25844 invoked by alias); 17 Feb 2010 14:46:24 -0000 Received: (qmail 25835 invoked by uid 22791); 17 Feb 2010 14:46:23 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Feb 2010 14:46:19 +0000 Received: (qmail 3405 invoked from network); 17 Feb 2010 14:46:18 -0000 Received: from unknown (HELO caradoc.them.org) (dan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 17 Feb 2010 14:46:18 -0000 Date: Wed, 17 Feb 2010 14:46:00 -0000 From: Daniel Jacobowitz To: Jan Kratochvil Cc: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [patch] STT_GNU_IFUNC support Message-ID: <20100217144614.GI9493@caradoc.them.org> References: <20100214203512.GA838@host0.dyn.jankratochvil.net> <20100215184048.GA16276@caradoc.them.org> <201002171234.15169.pedro@codesourcery.com> <20100217141912.GA28715@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100217141912.GA28715@host0.dyn.jankratochvil.net> 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: 2010-02/txt/msg00419.txt.bz2 On Wed, Feb 17, 2010 at 03:19:12PM +0100, Jan Kratochvil wrote: > (C) Print just the bare ifunc-resolver address for "p strcmp". > > +(CACHE) = + possibility: Cache the pointer in GDB. > > "Regular users" just print "strcmp (...)" and do not print "strcmp" which > possibly makes (C) a viable option. I don't know. What about "disassemble strcmp" - I think it should disassemble the same thing that will show up in the assembly as "call 0x$hex ". But maybe automatically disassembling strcmp_sse is more useful. Hmm. I guess that leaves "break strcmp" in a weird place since strcmp will only be called once. Maybe a breakpoint on an indirect function should also set a breakpoint on the target of the indirect function? This is slightly awkward to implement because there's no debug hook after the indirect function returns; we'd have to do that automatically to set the second breakpoint, or risk missing calls. I'm open to suggestions. > I would choose (A) + (CACHE) myself. I did not find (CACHE) to be such > a concern to implement it. Inferior calls may be slow on embedded targets? Inferior calls are hundreds of times slower than symbol lookups. GDB can do a lot of symbol lookups behind the scenes, for instance "info func" will do a lookup_symbol for every function. Since native x86_64 Linux inferior calls are only hundreds of times slower, you may not notice this as much. On a slower target, or a remote target, it may be thousands of times slower. -- Daniel Jacobowitz CodeSourcery