This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH RFA] symtab.c: Don't coredump on ``b .''
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [PATCH RFA] symtab.c: Don't coredump on ``b .''
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Fri, 1 Sep 2000 11:12:39 -0700
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