This is the mail archive of the 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]

Re: PATCH: Fix openp() if the file doesn't exist

On Thu, Jan 09, 2003 at 05:41:55PM -0500, Daniel Jacobowitz wrote:
> Sometime last April, when Joel committed a patch to not try to open
> directories as programs, we started always searching the given path in
> openp ().  Try it:
> % gdb ./ls
> will open /bin/ls if there is no ls in the current directory.
> Anyone see a problem with this patch?  If not I'll commit it in a day or
> two; also to 5.3 on the off chance we have another release.  This is one of
> my two big annoyances at 5.3 (and HEAD).  The other is that backtrace

Checked in, with the following patch to squelch a GCC warning.  It's a
false positive for the uninitialized checking.

Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-01-13  Daniel Jacobowitz  <>

	* source.c (openp): Squelch warning about "filename".

Index: source.c
RCS file: /cvs/src/src/gdb/source.c,v
retrieving revision 1.40
diff -u -p -r1.40 source.c
--- source.c	13 Jan 2003 20:12:57 -0000	1.40
+++ source.c	13 Jan 2003 20:24:53 -0000
@@ -687,7 +687,10 @@ openp (const char *path, int try_cwd_fir
 	    goto done;
-	fd = -1;
+	{
+	  filename = NULL;
+	  fd = -1;
+	}
       for (i = 0; string[i]; i++)
 	if (IS_DIR_SEPARATOR (string[i]))

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