(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 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 *.
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];
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;
#include "cli/cli-script.h"
#include "cli/cli-setshow.h"
#include "cli/cli-cmds.h"
+#include "cli/cli-utils.h"
#include "python/python.h"
{
/* Make sure leading white space does not break the
comparisons. */
- while (isspace(args[0]))
- args++;
+ args = skip_spaces (args);
if (args[0] != '-')
break;
break;
}
- while (isspace (args[0]))
- args++;
- file = args;
+ file = skip_spaces (args);
}
source_script_with_search (file, from_tty, search_path);
}
}
- while (isspace (*arg))
- ++arg;
+ arg = skip_spaces (arg);
}
if (! arg || ! *arg)
/* Two arguments. */
int incl_flag = 0;
low = pc;
- while (isspace (*arg))
- arg++;
+ arg = skip_spaces (arg);
if (arg[0] == '+')
{
++arg;
#include "gdbcmd.h"
#include "value.h"
#include "target.h"
+#include "cli/cli-utils.h"
/* Copied from bfd_put_bits. */
}
}
- while (isspace (*s))
- ++s;
+ s = skip_spaces (s);
}
/* Get the search range. */
if (*s == ',')
++s;
- while (isspace (*s))
- ++s;
+ s = skip_spaces (s);
if (*s == '+')
{
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);
if (*s == ',')
++s;
- while (isspace (*s))
- ++s;
+ s = skip_spaces (s);
}
if (pattern_buf_end == pattern_buf)
#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>
if (arg && *arg)
{
- while (*arg && isspace(*arg))
- arg++;
+ arg = skip_spaces (arg);
if (*arg)
{
if (arg && *arg)
{
- while (*arg && isspace(*arg))
- arg++;
+ arg = skip_spaces (arg);
if (*arg)
{
if (arg && *arg)
{
- while (*arg && isspace(*arg))
- arg++;
+ arg = skip_spaces (arg);
if (*arg)
{
if (arg && *arg)
{
- while (*arg && isspace(*arg))
- arg++;
+ arg = skip_spaces (arg);
if (*arg)
{
if (arg && *arg)
{
- while (*arg && isspace(*arg))
- arg++;
+ arg = skip_spaces (arg);
if (*arg)
{
if (arg && *arg)
{
- while (*arg && isspace(*arg))
- arg++;
+ arg = skip_spaces (arg);
if (*arg)
addr = parse_and_eval_address (arg);
#include "inf-loop.h"
#include "continuations.h"
#include "linespec.h"
+#include "cli/cli-utils.h"
/* Local functions: */
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. */
p++;
*endaddr = strtoulst (p, &p, 16);
- while (*p && isspace (*p))
- p++;
+ p = skip_spaces_const (p);
*permissions = p;
while (*p && !isspace (*p))
p++;
*offset = strtoulst (p, &p, 16);
- while (*p && isspace (*p))
- p++;
+ p = skip_spaces_const (p);
*device = p;
while (*p && !isspace (*p))
p++;
*inode = strtoulst (p, &p, 10);
- while (*p && isspace (*p))
- p++;
+ p = skip_spaces_const (p);
*filename = p;
}
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, ')');
}
}
- while (*p && isspace (*p))
- p++;
+ p = skip_spaces_const (p);
if (*p)
printf_filtered (_("State: %c\n"), *p++);
#include "linux-procfs.h"
#include "linux-osdata.h"
#include "auto-load.h"
+#include "cli/cli-utils.h"
#include <signal.h>
#include <ctype.h>
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"));
#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!
/* 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 "
#include "gdb_assert.h"
#include "cli/cli-decode.h"
+#include "cli/cli-utils.h"
extern void _initialize_maint_cmds (void);
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)
{
#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. */
char *arg;
/* Skip leading white space. */
- while (isspace (*chp))
- chp++;
+ chp = skip_spaces (chp);
/* Three possibilities: EOF, quoted string, or other text. */
switch (*chp)
{
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++)
/* 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;
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
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
#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
while (*string && *string != '(')
{
- while (isspace (*string))
- ++string;
+ string = skip_spaces_const (string);
if (*string && *string != '(')
{
hash = SYMBOL_HASH_NEXT (hash, *string);
#include "infcall.h"
#include "valprint.h"
#include "gdb_assert.h"
+#include "cli/cli-utils.h"
#include <ctype.h>
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;
}
*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)
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;
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++;
*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)
#include "serial.h"
#include "readline/tilde.h"
#include "python.h"
+#include "cli/cli-utils.h"
#include <ctype.h>
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);
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))
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
#include <signal.h>
#include <time.h>
#include "gdb_bfd.h"
-
+#include "cli/cli-utils.h"
#include "serial.h"
{
char *arg;
- while (isspace (*args))
- args++;
+ args = skip_spaces (arg);
arg = args;
#include "serial.h"
#include "gdb_string.h"
#include "gdbcmd.h"
+#include "cli/cli-utils.h"
extern void _initialize_serial (void);
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
#include "disasm.h"
#include "inline-frame.h"
#include "linespec.h"
+#include "cli/cli-utils.h"
#include "gdb_assert.h"
#include <ctype.h>
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;
#include "remote.h"
#include "stack.h"
#include "gdb_bfd.h"
+#include "cli/cli-utils.h"
#include <sys/types.h>
#include <fcntl.h>
*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 -- "
#include "go-lang.h"
#include "p-lang.h"
#include "addrmap.h"
+#include "cli/cli-utils.h"
#include "hashtab.h"
file_name[colon_index--] = 0;
files = &file_name;
nfiles = 1;
- regexp = colon + 1;
- while (isspace (*regexp)) regexp++;
+ regexp = skip_spaces (colon + 1);
}
}
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);
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. */
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. */
{
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)
{
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)
{
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)
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))
{
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;
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);
}
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);
}
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". */
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, ',');