Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LVuSW-00038U-KG for mharc-grub-devel@gnu.org; Sat, 07 Feb 2009 16:11:28 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVuST-000386-NO for grub-devel@gnu.org; Sat, 07 Feb 2009 16:11:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVuSS-00037e-AN for grub-devel@gnu.org; Sat, 07 Feb 2009 16:11:25 -0500 Received: from [199.232.76.173] (port=52919 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVuSS-00037b-5Q for grub-devel@gnu.org; Sat, 07 Feb 2009 16:11:24 -0500 Received: from aybabtu.com ([69.60.117.155]:37531) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LVuSR-0008HZ-Qq for grub-devel@gnu.org; Sat, 07 Feb 2009 16:11:24 -0500 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1LVuNF-00062R-TN for grub-devel@gnu.org; Sat, 07 Feb 2009 22:06:02 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1LVuRx-0001al-JG for grub-devel@gnu.org; Sat, 07 Feb 2009 22:10:53 +0100 Date: Sat, 7 Feb 2009 22:10:53 +0100 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090207211053.GN988@thorin> References: <20090116212812.GA14507@pina.cat> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090116212812.GA14507@pina.cat> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: changing a function pointer in a module X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 21:11:26 -0000 On Fri, Jan 16, 2009 at 10:28:12PM +0100, Carles Pina i Estany wrote: > > Hello, > > I'm doing some more gettext stuff. Right now I have (relevant code for > the problem): > > (briefly: the problem is that I'm changing a function pointer inside > gettext module code and it's not changed in other parts in Grub, even > when it's defined in include/grub/misc.h and only there) > > include/grub/misc.h: > char* EXPORT_FUNC(grub_gettext_dummy) (const char *s); > char* EXPORT_FUNC((*grub_gettext)) (const char *s); > > (I've done tests without EXPORT_FUNC and with EXPORT_VAR for > grub_gettext) > > In normal/main.c, GRUB_MOD_INIT(normal) I have: > grub_gettext = grub_gettext_dummy; > > In normal/cmdline.c, in grub_cmdline_run and after "ESC at any time > exits": > grub_printf("grub_gettext: %d\n",grub_gettext); > > In gettext/gettext.c, GRUB_MOD_INIT(gettext): > grub_gettext = grub_gettext_translate; > grub_printf("grub_gettext: %d\n",grub_gettext); > > First time that I type "C" in Grub menu, I read grub_gettext: XXXX. > > Then I insmod my module and it prints grub_printf("grub_gettext: > %d\n",grub_gettext); (different value, of course). > > I press ESC (to go to Grub menu) and C (to go to the command line) and I > get the first grub_gettext value, not the one that I changed. > > How so? I don't declare grub_gettext again, how I can change (and check > that it's changed) but not changed back? > > I even tried to not assign in normal/main.c (just in case that code part > is executed two times) but still it didn't work (again, value has not > been changed). IIRC we sorted out these issues in our meeting, please let me know if something is missing. -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."