This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH RFA] symtab.c: Don't coredump on ``b .''
- To: Kevin Buettner <kevinb at cygnus dot com>
- Subject: Re: [PATCH RFA] symtab.c: Don't coredump on ``b .''
- From: Michael Snyder <msnyder at redhat dot com>
- Date: Fri, 01 Sep 2000 11:16:31 -0700
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Red Hat, Inc.
- References: <1000901181238.ZM11161@ocotillo.lan>
Kevin Buettner wrote:
>
> The patch below fixes a gdb coredump when you enter the command
>
> b .
>
> Okay to commit?
I'll say yes, since JimB is probably occupied.
Michael
> * 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