From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15989 invoked by alias); 11 Dec 2003 14:24:37 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15981 invoked from network); 11 Dec 2003 14:24:35 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 11 Dec 2003 14:24:35 -0000 Received: from drow by nevyn.them.org with local (Exim 4.24 #1 (Debian)) id 1AURk3-0006w0-4p for ; Thu, 11 Dec 2003 09:24:35 -0500 Date: Thu, 11 Dec 2003 14:24:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [PATCH/RFC] observer tests & GCC 3.4 Message-ID: <20031211142435.GB26428@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <200312111355.hBBDtFE7000504@elgar.kettenis.dyndns.org> <20031211141416.GB1494@gnat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031211141416.GB1494@gnat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-12/txt/msg00318.txt.bz2 On Thu, Dec 11, 2003 at 09:14:16AM -0500, Joel Brobecker wrote: > > The compiler is getting too smart for its own good again. At the end > > of observer.c, we have a bit of code that used in the > > gdb.gdb/observer.exp testcase. Since the variables and functions are > > declared static, the compiler simply optimizes these out. The > > attached patch fixes this. Objections? > > Humph. I don't know of any other way to stop GDB from optimizing > them out, so no objection from me. You can do it with GCC-isms (the appropriate one in this case is __attribute__((__used__))), but I think that Mark's solution is a better one in this case. Making them global ought to fix the problem for good (since any compiler which supports shared objects will have to export them, since something like libthread_db might use them). > > Index: ChangeLog > > from Mark Kettenis > > > > * observer.c (observer_test_first_observer, > > observer_test_second_observer, observer_test_third_observer): > > Don't define as `static'. > > (observer_test_first_notification_function, > > observer_test_second_notification_function, > > observer_test_third_notification_function): Likewise. > > -- > Joel > -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer