[patch 3/3] Various linespec fixups [Re: [RFA] c++/11734 revisited]

Jan Kratochvil
2011-02-06T22:46:46Z

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)