]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* breakpoint.c (catch_syscall_split_args): Use skip_spaces.
authorKeith Seitz <keiths@redhat.com>
Thu, 7 Mar 2013 21:57:30 +0000 (21:57 +0000)
committerKeith Seitz <keiths@redhat.com>
Thu, 7 Mar 2013 21:57:30 +0000 (21:57 +0000)
(trace_pass_command): Likewise.
* cli/cli-cmds.c: Include cli/cli-utils.h.
(source_command): Use skip-spaces.
(disassemble_command): Likewise.
* findcmd.c: Include cli/cli-utils.h.
(parse_find_args): Use skip_spaces.
* go32-nat.c: Include cli/cli-utils.h.
(go32_sldt): Use skip_spaces.
(go32_sgdt): Likewise.
(go32_sidt): Likewise.
(go32_pde): Likewise.
(go32_pte): Likewise.
(go32_pte_for_address): Likewise.
* infcmd.c: Include cli/cli-utils.h.
(registers_info): Use skip_spaces.
* linux-tdep.c (read_mapping): Use skip_spaces_const.
(linux_info_proc): Likewise.
* linux-thread-db.c: Include cli/cli-utils.h.
(info_auto_load_libthread_db): Use skip_spaces_const.
* m32r-rom.c: Include cli/cli-utils.h.
(m32r_upload_command): Use skip_spaces.
* maint.c: Include cli/cli-utils.h.
(maintenance_translate_address): Use skip_spaces.
* mi/mi-parse.c: Include cli/cli-utils.h.
(mi_parse_argv): Use skip_spaces.
(mi_parse): Likewise.
* minsyms.c: Include cli/cli-utils.h.
(msymbol_hash_iw): Use skip_spaces_const.
* objc-lang.c: Include cli/cli-utils.h.
(parse_selector): Use skip_spaces.
(parse_method): Likewise.
* python/python.c: Include cli/cli-utils.h.
(python_interactive_command)[HAVE_PYTHON]: Use skip_spaces.
(python_command)[HAVE_PYTHON]: Likewise.
(python_interactive_command)[!HAVE_PYTHON]: Likewise.
* remote-m32r-sdi.c: Include cli/cli-utils.h.
(m32r_load): Use skip_spaces.
* serial.c: Include cli/cli-utils.h.
(serial_open): Use skip_spaces_const.
* stack.c: Include cli/cli-utils.h.
(parse_frame_specification_1): Use skip_spaces_const.
* symfile.c: Include cli/cli-utils.h.
(set_ext_lang_command): Use skip_spaces.
* symtab.c: Include cli/cli-utils.h.
(rbreak_command): Use skip_spaces.
* thread.c (thread_name_command): Use skip_spaces.
* tracepoint.c (validate_actionline): Use skip_spaces.
(encode_actions_1): Likewise.
(trace_find_range_command): Likewise.
(trace_find_outside_command): Likewise.
(trace_dump_actions): Likewise.

21 files changed:
gdb/ChangeLog
gdb/breakpoint.c
gdb/cli/cli-cmds.c
gdb/findcmd.c
gdb/go32-nat.c
gdb/infcmd.c
gdb/linux-tdep.c
gdb/linux-thread-db.c
gdb/m32r-rom.c
gdb/maint.c
gdb/mi/mi-parse.c
gdb/minsyms.c
gdb/objc-lang.c
gdb/python/python.c
gdb/remote-m32r-sdi.c
gdb/serial.c
gdb/stack.c
gdb/symfile.c
gdb/symtab.c
gdb/thread.c
gdb/tracepoint.c

index c8787fc454f2b17db9adf7a0761881ed980fd92c..87ffb54a42f176c6262aa44a52bcc11714ef9218 100644 (file)
@@ -1,3 +1,58 @@
+2013-03-07  Keith Seitz  <keiths@redhat.com>
+
+       * breakpoint.c (catch_syscall_split_args): Use skip_spaces.
+       (trace_pass_command): Likewise.
+       * cli/cli-cmds.c: Include cli/cli-utils.h.
+       (source_command): Use skip-spaces.
+       (disassemble_command): Likewise.
+       * findcmd.c: Include cli/cli-utils.h.
+       (parse_find_args): Use skip_spaces.
+       * go32-nat.c: Include cli/cli-utils.h.
+       (go32_sldt): Use skip_spaces.
+       (go32_sgdt): Likewise.
+       (go32_sidt): Likewise.
+       (go32_pde): Likewise.
+       (go32_pte): Likewise.
+       (go32_pte_for_address): Likewise.
+       * infcmd.c: Include cli/cli-utils.h.
+       (registers_info): Use skip_spaces.
+       * linux-tdep.c (read_mapping): Use skip_spaces_const.
+       (linux_info_proc): Likewise.
+       * linux-thread-db.c: Include cli/cli-utils.h.
+       (info_auto_load_libthread_db): Use skip_spaces_const.
+       * m32r-rom.c: Include cli/cli-utils.h.
+       (m32r_upload_command): Use skip_spaces.
+       * maint.c: Include cli/cli-utils.h.
+       (maintenance_translate_address): Use skip_spaces.
+       * mi/mi-parse.c: Include cli/cli-utils.h.
+       (mi_parse_argv): Use skip_spaces.
+       (mi_parse): Likewise.
+       * minsyms.c: Include cli/cli-utils.h.
+       (msymbol_hash_iw): Use skip_spaces_const.
+       * objc-lang.c: Include cli/cli-utils.h.
+       (parse_selector): Use skip_spaces.
+       (parse_method): Likewise.
+       * python/python.c: Include cli/cli-utils.h.
+       (python_interactive_command)[HAVE_PYTHON]: Use skip_spaces.
+       (python_command)[HAVE_PYTHON]: Likewise.
+       (python_interactive_command)[!HAVE_PYTHON]: Likewise.
+       * remote-m32r-sdi.c: Include cli/cli-utils.h.
+       (m32r_load): Use skip_spaces.
+       * serial.c: Include cli/cli-utils.h.
+       (serial_open): Use skip_spaces_const.
+       * stack.c: Include cli/cli-utils.h.
+       (parse_frame_specification_1): Use skip_spaces_const.
+       * symfile.c: Include cli/cli-utils.h.
+       (set_ext_lang_command): Use skip_spaces.
+       * symtab.c: Include cli/cli-utils.h.
+       (rbreak_command): Use skip_spaces.
+       * thread.c (thread_name_command): Use skip_spaces.
+       * tracepoint.c (validate_actionline): Use skip_spaces.
+       (encode_actions_1): Likewise.
+       (trace_find_range_command): Likewise.
+       (trace_find_outside_command): Likewise.
+       (trace_dump_actions): Likewise.
+
 2013-03-07  Pedro Alves  <palves@redhat.com>
 
        * c-lang.c (parse_one_string): Cast argument to gdb_byte *.
index d71bb36cadedc2cded2247aa7178c6dbba137fe4..d6f8bc582f77e1b054738e8e66c77de61db538b3 100644 (file)
@@ -11768,8 +11768,7 @@ catch_syscall_split_args (char *arg)
       struct syscall s;
 
       /* Skip whitespace.  */
-      while (isspace (*arg))
-       arg++;
+      arg = skip_spaces (arg);
 
       for (i = 0; i < 127 && arg[i] && !isspace (arg[i]); ++i)
        cur_name[i] = arg[i];
@@ -15370,9 +15369,7 @@ trace_pass_command (char *args, int from_tty)
 
   count = strtoul (args, &args, 10);   /* Count comes first, then TP num.  */
 
-  while (*args && isspace ((int) *args))
-    args++;
-
+  args = skip_spaces (args);
   if (*args && strncasecmp (args, "all", 3) == 0)
     {
       struct breakpoint *b;
index 680cf992de9887e0609c638374c3da39e9f0ec5f..0d37d578b451e3f72e59b93b8ec255aa5b300cb0 100644 (file)
@@ -47,6 +47,7 @@
 #include "cli/cli-script.h"
 #include "cli/cli-setshow.h"
 #include "cli/cli-cmds.h"
+#include "cli/cli-utils.h"
 
 #include "python/python.h"
 
@@ -624,8 +625,7 @@ source_command (char *args, int from_tty)
        {
          /* Make sure leading white space does not break the
             comparisons.  */
-         while (isspace(args[0]))
-           args++;
+         args = skip_spaces (args);
 
          if (args[0] != '-')
            break;
@@ -648,9 +648,7 @@ source_command (char *args, int from_tty)
            break;
        }
 
-      while (isspace (args[0]))
-       args++;
-      file = args;
+      file = skip_spaces (args);
     }
 
   source_script_with_search (file, from_tty, search_path);
@@ -1141,8 +1139,7 @@ disassemble_command (char *arg, int from_tty)
            }
        }
 
-      while (isspace (*arg))
-       ++arg;
+      arg = skip_spaces (arg);
     }
 
   if (! arg || ! *arg)
@@ -1175,8 +1172,7 @@ disassemble_command (char *arg, int from_tty)
       /* Two arguments.  */
       int incl_flag = 0;
       low = pc;
-      while (isspace (*arg))
-       arg++;
+      arg = skip_spaces (arg);
       if (arg[0] == '+')
        {
          ++arg;
index 1f970c0eb53727e7253d5af088e8a3201bc5ef9c..cd26f04ebedc679a41f8c3ce633e5b32e24cedd0 100644 (file)
@@ -24,6 +24,7 @@
 #include "gdbcmd.h"
 #include "value.h"
 #include "target.h"
+#include "cli/cli-utils.h"
 
 /* Copied from bfd_put_bits.  */
 
@@ -109,8 +110,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
            }
        }
 
-      while (isspace (*s))
-       ++s;
+      s = skip_spaces (s);
     }
 
   /* Get the search range.  */
@@ -120,8 +120,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
 
   if (*s == ',')
     ++s;
-  while (isspace (*s))
-    ++s;
+  s = skip_spaces (s);
 
   if (*s == '+')
     {
@@ -172,8 +171,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
       struct type *t;
       ULONGEST pattern_buf_size_need;
 
-      while (isspace (*s))
-       ++s;
+      s = skip_spaces (s);
 
       v = parse_to_comma_and_eval (&s);
       t = value_type (v);
@@ -221,8 +219,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
 
       if (*s == ',')
        ++s;
-      while (isspace (*s))
-       ++s;
+      s = skip_spaces (s);
     }
 
   if (pattern_buf_end == pattern_buf)
index cbd8e40164e4700703540d5c1bc4f122688c1f60..3fab6683e00fa2201feac69dc57d85cef4d47d17 100644 (file)
 #include "regcache.h"
 #include "gdb_string.h"
 #include "top.h"
+#include "cli/cli-utils.h"
 
 #include <stdio.h>             /* might be required for __DJGPP_MINOR__ */
 #include <stdlib.h>
@@ -1702,8 +1703,7 @@ go32_sldt (char *arg, int from_tty)
 
   if (arg && *arg)
     {
-      while (*arg && isspace(*arg))
-       arg++;
+      arg = skip_spaces (arg);
 
       if (*arg)
        {
@@ -1773,8 +1773,7 @@ go32_sgdt (char *arg, int from_tty)
 
   if (arg && *arg)
     {
-      while (*arg && isspace(*arg))
-       arg++;
+      arg = skip_spaces (arg);
 
       if (*arg)
        {
@@ -1815,8 +1814,7 @@ go32_sidt (char *arg, int from_tty)
 
   if (arg && *arg)
     {
-      while (*arg && isspace(*arg))
-       arg++;
+      arg = skip_spaces (arg);
 
       if (*arg)
        {
@@ -1986,8 +1984,7 @@ go32_pde (char *arg, int from_tty)
 
   if (arg && *arg)
     {
-      while (*arg && isspace(*arg))
-       arg++;
+      arg = skip_spaces (arg);
 
       if (*arg)
        {
@@ -2037,8 +2034,7 @@ go32_pte (char *arg, int from_tty)
 
   if (arg && *arg)
     {
-      while (*arg && isspace(*arg))
-       arg++;
+      arg = skip_spaces (arg);
 
       if (*arg)
        {
@@ -2065,8 +2061,7 @@ go32_pte_for_address (char *arg, int from_tty)
 
   if (arg && *arg)
     {
-      while (*arg && isspace(*arg))
-       arg++;
+      arg = skip_spaces (arg);
 
       if (*arg)
        addr = parse_and_eval_address (arg);
index 1ef3b48715212e93c78b893438bd7745907a258c..866388f3db7902429788d6d808b4db86c142c20a 100644 (file)
@@ -56,6 +56,7 @@
 #include "inf-loop.h"
 #include "continuations.h"
 #include "linespec.h"
+#include "cli/cli-utils.h"
 
 /* Local functions: */
 
@@ -2185,12 +2186,8 @@ registers_info (char *addr_exp, int fpregs)
       char *start;
       const char *end;
 
-      /* Keep skipping leading white space.  */
-      if (isspace ((*addr_exp)))
-       {
-         addr_exp++;
-         continue;
-       }
+      /* Skip leading white space.  */
+      addr_exp = skip_spaces (addr_exp);
 
       /* Discard any leading ``$''.  Check that there is something
          resembling a register following it.  */
index 04afbb17aaabd76c864c4c36428489ba36c8747e..a132fc6b8816aadf924759c737f9284e67ea6dba 100644 (file)
@@ -225,8 +225,7 @@ read_mapping (const char *line,
     p++;
   *endaddr = strtoulst (p, &p, 16);
 
-  while (*p && isspace (*p))
-    p++;
+  p = skip_spaces_const (p);
   *permissions = p;
   while (*p && !isspace (*p))
     p++;
@@ -234,8 +233,7 @@ read_mapping (const char *line,
 
   *offset = strtoulst (p, &p, 16);
 
-  while (*p && isspace (*p))
-    p++;
+  p = skip_spaces_const (p);
   *device = p;
   while (*p && !isspace (*p))
     p++;
@@ -243,8 +241,7 @@ read_mapping (const char *line,
 
   *inode = strtoulst (p, &p, 10);
 
-  while (*p && isspace (*p))
-    p++;
+  p = skip_spaces_const (p);
   *filename = p;
 }
 
@@ -409,8 +406,7 @@ linux_info_proc (struct gdbarch *gdbarch, char *args,
          printf_filtered (_("Process: %s\n"),
                           pulongest (strtoulst (p, &p, 10)));
 
-         while (*p && isspace (*p))
-           p++;
+         p = skip_spaces_const (p);
          if (*p == '(')
            {
              const char *ep = strchr (p, ')');
@@ -422,8 +418,7 @@ linux_info_proc (struct gdbarch *gdbarch, char *args,
                }
            }
 
-         while (*p && isspace (*p))
-           p++;
+         p = skip_spaces_const (p);
          if (*p)
            printf_filtered (_("State: %c\n"), *p++);
 
index e3d893a99724766b6efafbc698461251ef8d2b76..a698c659fc93387deb816c6ba54f96590785b363 100644 (file)
@@ -42,6 +42,7 @@
 #include "linux-procfs.h"
 #include "linux-osdata.h"
 #include "auto-load.h"
+#include "cli/cli-utils.h"
 
 #include <signal.h>
 #include <ctype.h>
@@ -1926,8 +1927,7 @@ info_auto_load_libthread_db (char *args, int from_tty)
   char *pids;
   int i;
 
-  while (isspace (*cs))
-    cs++;
+  cs = skip_spaces_const (cs);
   if (*cs)
     error (_("'info auto-load libthread-db' does not accept any parameters"));
 
index bf1af5cada4b06699f8c4ec68682db9c1f9acc9b..aab59f0d547b4befa4656879494089ba386e40e4 100644 (file)
@@ -40,6 +40,7 @@
 #include <ctype.h>
 #include "regcache.h"
 #include "gdb_bfd.h"
+#include "cli/cli-utils.h"
 
 /*
  * All this stuff just to get my host computer's IP address!
@@ -448,8 +449,7 @@ m32r_upload_command (char *args, int from_tty)
       /* Scan second colon in the output from the "ust" command.  */
       char *myIPaddress = strchr (strchr (buf, ':') + 1, ':') + 1;
 
-      while (isspace (*myIPaddress))
-       myIPaddress++;
+      myIPaddress = skip_spaces (myIPaddress);
 
       if (!strncmp (myIPaddress, "0.0.", 4))   /* empty */
        error (_("Please use 'set board-address' to "
index 467e46b69cb9b07f47cc3d6be5cf24282f6b14e1..b835db6a5482fb874ee89fdfbf401a3542697e6e 100644 (file)
@@ -38,6 +38,7 @@
 #include "gdb_assert.h"
 
 #include "cli/cli-decode.h"
+#include "cli/cli-utils.h"
 
 extern void _initialize_maint_cmds (void);
 
@@ -460,8 +461,7 @@ maintenance_translate_address (char *arg, int from_tty)
       if (*p == '\000')                /* End of command?  */
        error (_("Need to specify <section-name> and <address>"));
       *p++ = '\000';
-      while (isspace (*p))
-       p++;                    /* Skip whitespace.  */
+      p = skip_spaces (p);
 
       ALL_OBJSECTIONS (objfile, sect)
       {
index 265d99fa34b13fb87eae32eb3b9bbc6b1946301b..407869d63ac057ab751ae61170bc90345704f2b5 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <ctype.h>
 #include "gdb_string.h"
+#include "cli/cli-utils.h"
 
 /* Like parse_escape, but leave the results as a host char, not a
    target char.  */
@@ -114,8 +115,7 @@ mi_parse_argv (char *args, struct mi_parse *parse)
       char *arg;
 
       /* Skip leading white space.  */
-      while (isspace (*chp))
-       chp++;
+      chp = skip_spaces (chp);
       /* Three possibilities: EOF, quoted string, or other text. */
       switch (*chp)
        {
@@ -244,8 +244,7 @@ mi_parse (char *cmd, char **token)
   cleanup = make_cleanup (mi_parse_cleanup, parse);
 
   /* Before starting, skip leading white space.  */
-  while (isspace (*cmd))
-    cmd++;
+  cmd = skip_spaces (cmd);
 
   /* Find/skip any token and then extract it.  */
   for (chp = cmd; *chp >= '0' && *chp <= '9'; chp++)
@@ -257,8 +256,7 @@ mi_parse (char *cmd, char **token)
   /* This wasn't a real MI command.  Return it as a CLI_COMMAND.  */
   if (*chp != '-')
     {
-      while (isspace (*chp))
-       chp++;
+      chp = skip_spaces (chp);
       parse->command = xstrdup (chp);
       parse->op = CLI_COMMAND;
 
@@ -284,8 +282,7 @@ mi_parse (char *cmd, char **token)
     error (_("Undefined MI command: %s"), parse->command);
 
   /* Skip white space following the command.  */
-  while (isspace (*chp))
-    chp++;
+  chp = skip_spaces (chp);
 
   /* Parse the --thread and --frame options, if present.  At present,
      some important commands, like '-break-*' are implemented by
@@ -343,8 +340,7 @@ mi_parse (char *cmd, char **token)
 
       if (*chp != '\0' && !isspace (*chp))
        error (_("Invalid value for the '%s' option"), option);
-      while (isspace (*chp))
-       chp++;
+      chp = skip_spaces (chp);
     }
 
   /* For new argv commands, attempt to return the parsed argument
index 779b9f9ffd441809d531dd3279b578843f1aba3f..059b70a6dc7a93a3116c94def854985e05672b4a 100644 (file)
@@ -50,6 +50,7 @@
 #include "target.h"
 #include "cp-support.h"
 #include "language.h"
+#include "cli/cli-utils.h"
 
 /* Accumulate the minimal symbols for each objfile in bunches of BUNCH_SIZE.
    At the end, copy them all into one newly allocated location on an objfile's
@@ -85,8 +86,7 @@ msymbol_hash_iw (const char *string)
 
   while (*string && *string != '(')
     {
-      while (isspace (*string))
-       ++string;
+      string = skip_spaces_const (string);
       if (*string && *string != '(')
        {
          hash = SYMBOL_HASH_NEXT (hash, *string);
index d4928aba6d93fac3ae15385f8cc5721620e88354..734fc5d01461f0034e688981e25ed1181c000c73 100644 (file)
@@ -44,6 +44,7 @@
 #include "infcall.h"
 #include "valprint.h"
 #include "gdb_assert.h"
+#include "cli/cli-utils.h"
 
 #include <ctype.h>
 
@@ -812,15 +813,13 @@ parse_selector (char *method, char **selector)
 
   s1 = method;
 
-  while (isspace (*s1))
-    s1++;
+  s1 = skip_spaces (s1);
   if (*s1 == '\'') 
     {
       found_quote = 1;
       s1++;
     }
-  while (isspace (*s1))
-    s1++;
+  s1 = skip_spaces (s1);
    
   nselector = s1;
   s2 = s1;
@@ -839,14 +838,12 @@ parse_selector (char *method, char **selector)
     }
   *s1++ = '\0';
 
-  while (isspace (*s2))
-    s2++;
+  s2 = skip_spaces (s2);
   if (found_quote)
     {
       if (*s2 == '\'') 
        s2++;
-      while (isspace (*s2))
-       s2++;
+      s2 = skip_spaces (s2);
     }
 
   if (selector != NULL)
@@ -875,21 +872,18 @@ parse_method (char *method, char *type, char **class,
   
   s1 = method;
 
-  while (isspace (*s1))
-    s1++;
+  s1 = skip_spaces (s1);
   if (*s1 == '\'') 
     {
       found_quote = 1;
       s1++;
     }
-  while (isspace (*s1))
-    s1++;
+  s1 = skip_spaces (s1);
   
   if ((s1[0] == '+') || (s1[0] == '-'))
     ntype = *s1++;
 
-  while (isspace (*s1))
-    s1++;
+  s1 = skip_spaces (s1);
 
   if (*s1 != '[')
     return NULL;
@@ -900,14 +894,12 @@ parse_method (char *method, char *type, char **class,
     s1++;
   
   s2 = s1;
-  while (isspace (*s2))
-    s2++;
+  s2 = skip_spaces (s2);
   
   if (*s2 == '(')
     {
       s2++;
-      while (isspace (*s2))
-       s2++;
+      s2 = skip_spaces (s2);
       ncategory = s2;
       while (isalnum (*s2) || (*s2 == '_'))
        s2++;
@@ -935,15 +927,13 @@ parse_method (char *method, char *type, char **class,
   *s1++ = '\0';
   s2++;
 
-  while (isspace (*s2))
-    s2++;
+  s2 = skip_spaces (s2);
   if (found_quote)
     {
       if (*s2 != '\'') 
        return NULL;
       s2++;
-      while (isspace (*s2))
-       s2++;
+      s2 = skip_spaces (s2);
     }
 
   if (type != NULL)
index 24be9068ca70b5b7aaae43761972486b44e198e0..cd8ddfbfc18b5c70cb9416eb2714a454514ba062 100644 (file)
@@ -32,6 +32,7 @@
 #include "serial.h"
 #include "readline/tilde.h"
 #include "python.h"
+#include "cli/cli-utils.h"
 
 #include <ctype.h>
 
@@ -222,8 +223,7 @@ python_interactive_command (char *arg, int from_tty)
   cleanup = make_cleanup_restore_integer (&interpreter_async);
   interpreter_async = 0;
 
-  while (arg && *arg && isspace (*arg))
-    ++arg;
+  arg = skip_spaces (arg);
 
   ensure_python_env (get_current_arch (), current_language);
 
@@ -367,8 +367,7 @@ python_command (char *arg, int from_tty)
   make_cleanup_restore_integer (&interpreter_async);
   interpreter_async = 0;
 
-  while (arg && *arg && isspace (*arg))
-    ++arg;
+  arg = skip_spaces (arg);
   if (arg && *arg)
     {
       if (PyRun_SimpleString (arg))
@@ -1333,8 +1332,7 @@ free_type_printers (void *arg)
 static void
 python_interactive_command (char *arg, int from_tty)
 {
-  while (arg && *arg && isspace (*arg))
-    ++arg;
+  arg = skip_spaces (arg);
   if (arg && *arg)
     error (_("Python scripting is not supported in this copy of GDB."));
   else
index 9d7e05dca26e022d515bd59a92c8771aad75afae..653cc7eff7d94a8478b334f11e332d1b6aacf894 100644 (file)
@@ -40,7 +40,7 @@
 #include <signal.h>
 #include <time.h>
 #include "gdb_bfd.h"
-
+#include "cli/cli-utils.h"
 
 #include "serial.h"
 
@@ -1234,8 +1234,7 @@ m32r_load (char *args, int from_tty)
     {
       char *arg;
 
-      while (isspace (*args))
-       args++;
+      args = skip_spaces (arg);
 
       arg = args;
 
index f0cd6b1c982d8f6e07908f26550feae4fd2d069a..3202b0f6baa7e4bc851f5c406da87ea865581a44 100644 (file)
@@ -22,6 +22,7 @@
 #include "serial.h"
 #include "gdb_string.h"
 #include "gdbcmd.h"
+#include "cli/cli-utils.h"
 
 extern void _initialize_serial (void);
 
@@ -194,8 +195,7 @@ serial_open (const char *name)
       ops = serial_interface_lookup ("pipe");
       /* Discard ``|'' and any space before the command itself.  */
       ++open_name;
-      while (isspace (*open_name))
-       ++open_name;
+      open_name = skip_spaces_const (open_name);
     }
   /* Check for a colon, suggesting an IP address/port pair.
      Do this *after* checking for all the interesting prefixes.  We
index 147d815fa7a4f3e722167bc0716441fbc8d7a021..f2aeb101bf90a3c2fc619b48d1cbe0acf9753e51 100644 (file)
@@ -46,6 +46,7 @@
 #include "disasm.h"
 #include "inline-frame.h"
 #include "linespec.h"
+#include "cli/cli-utils.h"
 
 #include "gdb_assert.h"
 #include <ctype.h>
@@ -1249,8 +1250,7 @@ parse_frame_specification_1 (const char *frame_exp, const char *message,
          const char *p;
 
          /* Skip leading white space, bail of EOL.  */
-         while (isspace (*frame_exp))
-           frame_exp++;
+         frame_exp = skip_spaces_const (frame_exp);
          if (!*frame_exp)
            break;
 
index 22a7970fa95d69031eb9499c7065212c666fb11e..5ed25913cb6ff4316a60413647a2645124d93c4b 100644 (file)
@@ -56,6 +56,7 @@
 #include "remote.h"
 #include "stack.h"
 #include "gdb_bfd.h"
+#include "cli/cli-utils.h"
 
 #include <sys/types.h>
 #include <fcntl.h>
@@ -2738,8 +2739,7 @@ set_ext_lang_command (char *args, int from_tty, struct cmd_list_element *e)
   *cp++ = '\0';
 
   /* Find beginning of second arg, which should be a source language.  */
-  while (*cp && isspace (*cp))
-    cp++;
+  cp = skip_spaces (cp);
 
   if (*cp == '\0')
     error (_("'%s': two arguments required -- "
index de2dbeee1cf8f0bcda1270119877d8afa761265c..c0e588455e165345118eb28b149d683806d48e5a 100644 (file)
@@ -40,6 +40,7 @@
 #include "go-lang.h"
 #include "p-lang.h"
 #include "addrmap.h"
+#include "cli/cli-utils.h"
 
 #include "hashtab.h"
 
@@ -3879,8 +3880,7 @@ rbreak_command (char *regexp, int from_tty)
            file_name[colon_index--] = 0; 
          files = &file_name;
          nfiles = 1;
-         regexp = colon + 1;
-         while (isspace (*regexp))  regexp++; 
+         regexp = skip_spaces (colon + 1);
        }
     }
 
index 6b53c7a2ebbfc70b56fff4031b1fcaca09467ce7..24e64133351b6a4c692ce37443ae585a54c73a7a 100644 (file)
@@ -1300,8 +1300,7 @@ thread_name_command (char *arg, int from_tty)
   if (ptid_equal (inferior_ptid, null_ptid))
     error (_("No thread selected"));
 
-  while (arg && isspace (*arg))
-    ++arg;
+  arg = skip_spaces (arg);
 
   info = inferior_thread ();
   xfree (info->name);
index c36c1a7bc852dd2dcb1e6ba26ac0cb686546f0f2..2a4b245493f266f99b79a3d99262ed0a2e3fa11a 100644 (file)
@@ -709,8 +709,7 @@ validate_actionline (char **line, struct breakpoint *b)
   if (*line == NULL)
     return;
 
-  for (p = *line; isspace ((int) *p);)
-    p++;
+  p = skip_spaces (*line);
 
   /* Symbol lookup etc.  */
   if (*p == '\0')      /* empty line: just prompt for another line.  */
@@ -732,8 +731,7 @@ validate_actionline (char **line, struct breakpoint *b)
       do
        {                       /* Repeat over a comma-separated list.  */
          QUIT;                 /* Allow user to bail out with ^C.  */
-         while (isspace ((int) *p))
-           p++;
+         p = skip_spaces (p);
 
          if (*p == '$')        /* Look for special pseudo-symbols.  */
            {
@@ -798,8 +796,7 @@ validate_actionline (char **line, struct breakpoint *b)
       do
        {                       /* Repeat over a comma-separated list.  */
          QUIT;                 /* Allow user to bail out with ^C.  */
-         while (isspace ((int) *p))
-           p++;
+         p = skip_spaces (p);
 
          tmp_p = p;
          for (loc = t->base.loc; loc; loc = loc->next)
@@ -832,8 +829,7 @@ validate_actionline (char **line, struct breakpoint *b)
     {
       char *steparg;           /* In case warning is necessary.  */
 
-      while (isspace ((int) *p))
-       p++;
+      p = skip_spaces (p);
       steparg = p;
 
       if (*p == '\0' || (t->step_count = strtol (p, &p, 0)) == 0)
@@ -1379,8 +1375,7 @@ encode_actions_1 (struct command_line *action,
     {
       QUIT;                    /* Allow user to bail out with ^C.  */
       action_exp = action->line;
-      while (isspace ((int) *action_exp))
-       action_exp++;
+      action_exp = skip_spaces (action_exp);
 
       cmd = lookup_cmd (&action_exp, cmdlist, "", -1, 1);
       if (cmd == 0)
@@ -1395,8 +1390,7 @@ encode_actions_1 (struct command_line *action,
          do
            {                   /* Repeat over a comma-separated list.  */
              QUIT;             /* Allow user to bail out with ^C.  */
-             while (isspace ((int) *action_exp))
-               action_exp++;
+             action_exp = skip_spaces (action_exp);
 
              if (0 == strncasecmp ("$reg", action_exp, 4))
                {
@@ -1557,8 +1551,7 @@ encode_actions_1 (struct command_line *action,
          do
            {                   /* Repeat over a comma-separated list.  */
              QUIT;             /* Allow user to bail out with ^C.  */
-             while (isspace ((int) *action_exp))
-               action_exp++;
+             action_exp = skip_spaces (action_exp);
 
                {
                  struct cleanup *old_chain = NULL;
@@ -2589,8 +2582,7 @@ trace_find_range_command (char *args, int from_tty)
   if (0 != (tmp = strchr (args, ',')))
     {
       *tmp++ = '\0';   /* Terminate start address.  */
-      while (isspace ((int) *tmp))
-       tmp++;
+      tmp = skip_spaces (tmp);
       start = parse_and_eval_address (args);
       stop = parse_and_eval_address (tmp);
     }
@@ -2623,8 +2615,7 @@ trace_find_outside_command (char *args, int from_tty)
   if (0 != (tmp = strchr (args, ',')))
     {
       *tmp++ = '\0';   /* Terminate start address.  */
-      while (isspace ((int) *tmp))
-       tmp++;
+      tmp = skip_spaces (tmp);
       start = parse_and_eval_address (args);
       stop = parse_and_eval_address (tmp);
     }
@@ -2819,8 +2810,7 @@ trace_dump_actions (struct command_line *action,
 
       QUIT;                    /* Allow user to bail out with ^C.  */
       action_exp = action->line;
-      while (isspace ((int) *action_exp))
-       action_exp++;
+      action_exp = skip_spaces (action_exp);
 
       /* The collection actions to be done while stepping are
          bracketed by the commands "while-stepping" and "end".  */
@@ -2858,8 +2848,7 @@ trace_dump_actions (struct command_line *action,
                  QUIT;         /* Allow user to bail out with ^C.  */
                  if (*action_exp == ',')
                    action_exp++;
-                 while (isspace ((int) *action_exp))
-                   action_exp++;
+                 action_exp = skip_spaces (action_exp);
 
                  next_comma = strchr (action_exp, ',');