From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6396 invoked by alias); 17 Feb 2010 14:19:32 -0000 Received: (qmail 6383 invoked by uid 22791); 17 Feb 2010 14:19:32 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_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; Wed, 17 Feb 2010 14:19:28 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1HEJIPN014129 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 17 Feb 2010 09:19:18 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1HEJEjF003038 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Feb 2010 09:19:16 -0500 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id o1HEJEf3029359; Wed, 17 Feb 2010 15:19:14 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id o1HEJCKI029357; Wed, 17 Feb 2010 15:19:12 +0100 Date: Wed, 17 Feb 2010 14:19:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org, Daniel Jacobowitz Subject: Re: [patch] STT_GNU_IFUNC support Message-ID: <20100217141912.GA28715@host0.dyn.jankratochvil.net> References: <20100214203512.GA838@host0.dyn.jankratochvil.net> <20100215184048.GA16276@caradoc.them.org> <201002171234.15169.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201002171234.15169.pedro@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-08-17) 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: 2010-02/txt/msg00418.txt.bz2 On Wed, 17 Feb 2010 13:34:15 +0100, Pedro Alves wrote: > On Monday 15 February 2010 18:40:50, Daniel Jacobowitz wrote: > > Do you mean that "print strcmp" or "break strcmp" is now going to do > > an inferior call? That doesn't seem like a good idea to me. I would > > like for some other maintainers to comment though. > > > > Inferior calls are very slow, and they can go wrong (pending signals, > > misbehaving programs, etc). I believe we should make an effort to > > minimize them. > > Yeah, agreed, we should avoid them the best we can. Possibilities known to me: (A) Call ifunc-resolver any time it is needed. = currently implemented. (B) Pick out the resolver result from .got.plt - if it is already there; otherwise (A). (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. When an inferior call of "strcmp (...)" is being made I do not find a problem doing also the ifunc-resolver call that time, do you? 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? > [ Not to mention that the scheduler-locking setting also applies to > them, meaning, in a multi-threaded environment, without more > care, these behind the scenes infcalls resume more than > you'd want (all-threads), which can be surprising, and make other > threads easily hit events while handling the infcall. Something > that IWBN to fix. ] If you are concerned about other threads running you should already use at least "set scheduler-locking step". It should be default anyway. What about making this GNU-IFUNC inferior call scheduling follow the "step" policy? Maybe the whole inferior calls should follow the "step" policy? Thanks, Jan