From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8242 invoked by alias); 29 May 2012 16:12:18 -0000 Received: (qmail 8221 invoked by uid 22791); 29 May 2012 16:12:16 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_BJ,T_RP_MATCHES_RCVD 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; Tue, 29 May 2012 16:12:01 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4TGBjeJ010723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 29 May 2012 12:11:45 -0400 Received: from host2.jankratochvil.net (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q4TGBec6010567 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 29 May 2012 12:11:43 -0400 Date: Tue, 29 May 2012 16:12:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: Pedro Alves , Tom Tromey , gdb-patches@sourceware.org Subject: Re: RFC for: "Re: Regression for gdb.fortran/library-module.exp [Re: [RFA] choose symbol from given block's objfile first.]" Message-ID: <20120529161140.GA9878@host2.jankratochvil.net> References: <20120514175913.GM10253@adacore.com> <20120514180624.GA16368@host2.jankratochvil.net> <20120515130851.GP10253@adacore.com> <20120516195718.GA10253@adacore.com> <20120518164815.GA11883@host2.jankratochvil.net> <20120528142727.GH5492@adacore.com> <20120528161200.GA19230@host2.jankratochvil.net> <20120529154436.GO5492@adacore.com> <20120529155527.GA9177@host2.jankratochvil.net> <20120529160201.GQ5492@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120529160201.GQ5492@adacore.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: 2012-05/txt/msg01026.txt.bz2 On Tue, 29 May 2012 18:02:01 +0200, Joel Brobecker wrote: > > Just a gdbarch design detail - gdbarch attribute should be a real function so > > that the default (SVR4-compatible) implementation can just ignore the > > context_objfile parameter. The MS-Windows implementation will unconditionally > > follow context_objfile. This will not clutter the default code with > > MS-Windows specifics. > > I don't understand what you are trying to say regarding the gdbarch > attribute. Do you mean that, instead of a yes/no integer, it should > be a pointer to a function returning the yes/no integer? It should be a pointer to function implementing the functionality - which differs across platforms: M:void:iterate_over_objfiles_in_search_order: iterate_over_objfiles_in_search_order_cb cb, void *cb_data, struct objfile *context_objfile: cb, cb_data, context_objfile - I did not check it should be very exactly this way like m vs. M etc. default implementation: static void default_iterate_over_objfiles_in_search_order (iterate_over_objfiles_in_search_order_cb cb, void *cb_data, struct objfile *context_objfile) { int stop = 0; struct objfile *objfile; ALL_OBJFILES (objfile) { stop = cb (objfile, cb_data); if (stop) return; } } set_gdbarch_iterate_over_objfiles_in_search_order (gdbarch, default_iterate_over_objfiles_in_search_order); ms-windows implementation static void windows_iterate_over_objfiles_in_search_order (iterate_over_objfiles_in_search_order_cb cb, void *cb_data, struct objfile *context_objfile) { int stop = 0; struct objfile *objfile; if (context_objfile) { stop = cb (context_objfile, cb_data); if (stop) return; } ALL_OBJFILES (objfile) { if (objfile != context_objfile) { stop = cb (objfile, cb_data); if (stop) return; } } } set_gdbarch_iterate_over_objfiles_in_search_order (gdbarch, windows_iterate_over_objfiles_in_search_order); Thanks, Jan