From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7266 invoked by alias); 7 Jul 2003 14:17:57 -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 7259 invoked from network); 7 Jul 2003 14:17:56 -0000 Received: from unknown (HELO crack.them.org) (146.82.138.56) by sources.redhat.com with SMTP; 7 Jul 2003 14:17:56 -0000 Received: from dsl093-172-017.pit1.dsl.speakeasy.net ([66.93.172.17] helo=nevyn.them.org ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 19ZWpQ-00063Z-00; Mon, 07 Jul 2003 09:18:53 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 19ZWoF-00081H-00; Mon, 07 Jul 2003 10:17:39 -0400 Date: Mon, 07 Jul 2003 14:17:00 -0000 From: Daniel Jacobowitz To: fnf@ninemoons.com Cc: gdb-patches@sources.redhat.com Subject: Re: Default value for SOLIB_LOADED_LIBRARY_PATHNAME Message-ID: <20030707141738.GD27227@nevyn.them.org> Mail-Followup-To: fnf@ninemoons.com, gdb-patches@sources.redhat.com References: <200307031815.h63IFCq5029167@fred.ninemoons.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200307031815.h63IFCq5029167@fred.ninemoons.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-07/txt/msg00119.txt.bz2 On Thu, Jul 03, 2003 at 11:15:12AM -0700, Fred Fish wrote: > The default for SOLIB_LOADED_LIBRARY_PATHNAME should be something > other than zero. > > >From breakpoint.c: > > #if defined(SOLIB_HAVE_LOAD_EVENT) > && (!SOLIB_HAVE_LOAD_EVENT (PIDGET (inferior_ptid)) > || ((b->dll_pathname != NULL) > && (strcmp (b->dll_pathname, > SOLIB_LOADED_LIBRARY_PATHNAME ( > PIDGET (inferior_ptid))) > != 0))) > #endif > > Note that the result of evaluating SOLIB_LOADED_LIBRARY_PATHNAME is > given as an argument to strcmp. For compilers where strcmp is a > builtin, the compiler may notice that it is being passed a zero (NULL) > arg and complain. > > It is better to use a default of an empty string, like is done earlier > in breakpoint.c: > > #ifndef SOLIB_LOADED_LIBRARY_PATHNAME > #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) "" > #endif [With a changelog entry] this is OK. All this code desperately needs to die, but that's not your problem. > Index: coff-solib.h > =================================================================== > RCS file: /cvs/src/src/gdb/coff-solib.h,v > retrieving revision 1.4 > diff -c -p -r1.4 coff-solib.h > *** coff-solib.h 1 Nov 2001 16:17:08 -0000 1.4 > --- coff-solib.h 3 Jul 2003 18:08:14 -0000 > *************** extern void coff_solib_create_inferior_h > *** 109,115 **** > */ > > #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \ > ! (0) > > /* This function returns TRUE if the dynamic linker has just reported > an unload of a library. > --- 109,115 ---- > */ > > #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \ > ! "" > > /* This function returns TRUE if the dynamic linker has just reported > an unload of a library. > Index: solib.h > =================================================================== > RCS file: /cvs/src/src/gdb/solib.h,v > retrieving revision 1.9 > diff -c -p -r1.9 solib.h > *** solib.h 7 May 2002 08:35:54 -0000 1.9 > --- solib.h 3 Jul 2003 18:08:15 -0000 > *************** extern void solib_create_inferior_hook ( > *** 112,118 **** > */ > > #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \ > ! (0) > > /* This function returns TRUE if the dynamic linker has just reported > an unload of a library. > --- 112,118 ---- > */ > > #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \ > ! "" > > /* This function returns TRUE if the dynamic linker has just reported > an unload of a library. > -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer