From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17378 invoked by alias); 3 Jul 2003 18:15:31 -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 17364 invoked from network); 3 Jul 2003 18:15:28 -0000 Received: from unknown (HELO fred.ninemoons.com) (68.14.214.217) by sources.redhat.com with SMTP; 3 Jul 2003 18:15:28 -0000 Received: from fred.ninemoons.com (fred.ninemoons.com [127.0.0.1]) by fred.ninemoons.com (8.12.8/8.12.8) with ESMTP id h63IFHWe029169; Thu, 3 Jul 2003 11:15:27 -0700 Received: (from fnf@localhost) by fred.ninemoons.com (8.12.8/8.12.8/Submit) id h63IFCq5029167; Thu, 3 Jul 2003 11:15:12 -0700 From: Fred Fish Message-Id: <200307031815.h63IFCq5029167@fred.ninemoons.com> Subject: Default value for SOLIB_LOADED_LIBRARY_PATHNAME To: gdb-patches@sources.redhat.com Date: Thu, 03 Jul 2003 18:15:00 -0000 Cc: fnf@ninemoons.com Reply-To: fnf@ninemoons.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2003-07/txt/msg00082.txt.bz2 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 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.