Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Fred Fish <fnf@public.ninemoons.com>
To: gdb-patches@sources.redhat.com
Cc: fnf@ninemoons.com
Subject: Default value for SOLIB_LOADED_LIBRARY_PATHNAME
Date: Thu, 03 Jul 2003 18:15:00 -0000	[thread overview]
Message-ID: <200307031815.h63IFCq5029167@fred.ninemoons.com> (raw)

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.


             reply	other threads:[~2003-07-03 18:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-03 18:15 Fred Fish [this message]
2003-07-07 14:17 ` Daniel Jacobowitz
2003-07-08 20:30   ` Kevin Buettner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200307031815.h63IFCq5029167@fred.ninemoons.com \
    --to=fnf@public.ninemoons.com \
    --cc=fnf@ninemoons.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox