This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] nto_find_and_open_solib: Fix setting temp_pathname on failure.


Hi.
I found this while browsing the sources.
I have no means of testing this, but I think this is obvious.
Still, it could use another set of eyes.
{i386-,}nto-tdep.c is the only user of target_so_ops.find_and_open_solib
AFAICT.

Ok to check in?

2013-07-15  Doug Evans  <dje@google.com>

	* solist.h (target_so_ops.find_and_open_solib): Clarify usage of
	temp_pathname argument.
	* nto-tdep.c (nto_find_and_open_solib): Fix setting of temp_pathname
	when opening the file fails.

Index: nto-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/nto-tdep.c,v
retrieving revision 1.49
diff -u -p -r1.49 nto-tdep.c
--- nto-tdep.c	24 Jun 2013 22:18:31 -0000	1.49
+++ nto-tdep.c	15 Jul 2013 18:47:59 -0000
@@ -138,7 +138,7 @@ nto_find_and_open_solib (char *solib, un
 	  if (ret >= 0)
 	    *temp_pathname = gdb_realpath (arch_path);
 	  else
-	    **temp_pathname = '\0';
+	    *temp_pathname = NULL;
 	}
     }
   return ret;
Index: solist.h
===================================================================
RCS file: /cvs/src/src/gdb/solist.h,v
retrieving revision 1.40
diff -u -p -r1.40 solist.h
--- solist.h	4 Jun 2013 13:17:06 -0000	1.40
+++ solist.h	15 Jul 2013 18:47:59 -0000
@@ -129,8 +129,10 @@ struct target_so_ops
     /* Find and open shared library binary file.  */
     bfd *(*bfd_open) (char *pathname);
 
-    /* Extra hook for finding and opening a solib.
-       Convenience function for remote debuggers finding host libs.  */
+    /* Optional extra hook for finding and opening a solib.
+       If TEMP_PATHNAME is non-NULL: If the file is successfully opened a
+       pointer to a malloc'd and realpath'd copy of SONAME is stored there,
+       otherwise NULL is stored there.  */
     int (*find_and_open_solib) (char *soname,
         unsigned o_flags, char **temp_pathname);
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]