]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
commit 2bdc820adfead6aa7fdb16242280473af1040d4e
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 2 Jul 2011 19:34:43 +0000 (19:34 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 2 Jul 2011 19:34:43 +0000 (19:34 +0000)
Author: Keith Seitz <keiths@redhat.com>
Date:   Tue May 24 21:00:04 2011 +0000

gdb/
PR breakpoint/12803
* linespec.c (keep_name_info): Add handling for "volatile" keyword.
(decode_compound): Unconditionally call keep_name_info.

gdb/ChangeLog
gdb/linespec.c

index d0bb2b472d4ffb9e5ca6875b8b7ac155c5a16fe9..6293da198216da9aa810b275bc3c1dd78d627f75 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-02  Keith Seitz  <keiths@redhat.com>
+
+       PR breakpoint/12803
+       * linespec.c (keep_name_info): Add handling for "volatile" keyword.
+       (decode_compound): Unconditionally call keep_name_info.
+
 2011-07-02  Tom Tromey  <tromey@redhat.com>
 
        * tracepoint.c (scope_info): Update.
index 94bb86f90e0be6d2e8efaa685e4c8859d06b7ac6..f79df2e42c7f683532d2a4b0b00b106948c2ccd3 100644 (file)
@@ -714,8 +714,7 @@ keep_name_info (char *ptr)
   if (name_end (ptr))
     return remove_trailing_whitespace (start, ptr);
 
-  while (isspace (*p))
-    ++p;
+  p = skip_spaces (p);
   if (*p == '<')
     ptr = p = find_template_name_end (ptr);
 
@@ -730,12 +729,21 @@ keep_name_info (char *ptr)
     return remove_trailing_whitespace (start, ptr);
 
   /* Keep important keywords.  */  
-  while (isspace (*p))
-    ++p;
-  if (strncmp (p, "const", 5) == 0
-      && (isspace (p[5]) || p[5] == '\0'
-         || strchr (get_gdb_completer_quote_characters (), p[5]) != NULL))
-    ptr = p = p + 5;
+  while (1)
+    {
+      char *quotes = get_gdb_completer_quote_characters ();
+      p = skip_spaces (p);
+      if (strncmp (p, "const", 5) == 0
+         && (isspace (p[5]) || p[5] == '\0'
+             || strchr (quotes, p[5]) != NULL))
+       ptr = p = p + 5;
+      else if (strncmp (p, "volatile", 8) == 0
+              && (isspace (p[8]) || p[8] == '\0'
+                  || strchr (quotes, p[8]) != NULL))
+       ptr = p = p + 8;
+      else
+       break;
+    }
 
   return remove_trailing_whitespace (start, ptr);
 }
@@ -1573,9 +1581,7 @@ decode_compound (char **argptr, int funfirstline,
   /* We couldn't find a class, so we're in case 2 above.  We check the
      entire name as a symbol instead.  */
 
-  if (current_language->la_language == language_cplus
-      || current_language->la_language == language_java)
-    p = keep_name_info (p);
+  p = keep_name_info (p);
 
   copy = (char *) alloca (p - saved_arg2 + 1);
   memcpy (copy, saved_arg2, p - saved_arg2);