This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch 3/3] Various linespec fixups [Re: [RFA] c++/11734 revisited]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, gdb-patches at sourceware dot org
- Date: Sun, 6 Feb 2011 23:46:38 +0100
- Subject: [patch 3/3] Various linespec fixups [Re: [RFA] c++/11734 revisited]
- References: <4D002672.5090504@redhat.com> <m3oc8u1uzs.fsf@fleche.redhat.com> <4D07CD68.5000700@redhat.com>
Hi Keith,
[patch 3/3] is reapplication of (c).
that is various linespec fixes which you did along in the original physname
patch. THis set is not yet complete.
Jan
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -40,6 +40,7 @@
#include "interps.h"
#include "mi/mi-cmds.h"
#include "target.h"
+#include <ctype.h>
/* We share this one with symtab.c, but it is not exported widely. */
@@ -1007,6 +1008,17 @@ set_flags (char *arg, int *is_quoted, char **paren_pointer)
if (*paren_pointer != NULL)
*paren_pointer = strrchr (*paren_pointer, ')');
+ /* Make sure we keep important kewords like "const" */
+ if (*paren_pointer != NULL)
+ {
+ /* Skip trailing Java types. */
+ while ((*paren_pointer)[1] && !isspace ((*paren_pointer)[1]))
+ (*paren_pointer)++;
+
+ if (strncmp (*paren_pointer + 1, " const", 6) == 0)
+ (*paren_pointer) += 6;
+ }
+
/* Now that we're safely past the paren_pointer check, put back " if
(condition)" so outer layers can see it. */
if (has_if)