This is the mail archive of the gdb-patches@sources.redhat.com 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]

[PATCH RFA] symtab.c: Don't coredump on ``b .''


The patch below fixes a gdb coredump when you enter the command

    b .

Okay to commit?

	* symtab.c (decode_line_1):  Make sure leading character is
	actually a colon before skipping over leading colons in global
	namespace specification.

Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.13
diff -u -p -r1.13 symtab.c
--- symtab.c	2000/08/25 20:51:19	1.13
+++ symtab.c	2000/09/01 18:06:13
@@ -2642,7 +2642,8 @@ decode_line_1 (char **argptr, int funfir
 	  /* First check for "global" namespace specification,
 	     of the form "::foo". If found, skip over the colons
 	     and jump to normal symbol processing */
-	  if ((*argptr == p) || (p[-1] == ' ') || (p[-1] == '\t'))
+	  if (p[0] == ':' 
+	      && ((*argptr == p) || (p[-1] == ' ') || (p[-1] == '\t')))
 	    saved_arg2 += 2;
 
 	  /* We have what looks like a class or namespace


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