aboutsummaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-02-21 18:13:17 +0000
committerTom Tromey <tromey@redhat.com>2011-02-21 18:13:17 +0000
commite9cafbccd26b045ba6a3db2fde83dd33228e473b (patch)
tree2ff85b840a2849b1564202ebac2e3d2f17b541ce /gdb/printcmd.c
parentf67fd822d03bd263034b549d89d98e98356ff194 (diff)
downloadgdb-e9cafbccd26b045ba6a3db2fde83dd33228e473b.zip
gdb-e9cafbccd26b045ba6a3db2fde83dd33228e473b.tar.gz
gdb-e9cafbccd26b045ba6a3db2fde83dd33228e473b.tar.bz2
* reverse.c: Include cli-utils.h.
* printcmd.c: Include cli-utils.h. (string_printf): Use skip_spaces. * cli/cli-utils.h: New file. * cli/cli-utils.c: New file. * cli/cli-dump.h (skip_spaces): Move to cli-utils.h. * cli/cli-dump.c (skip_spaces): Move to cli-utils.c. * breakpoint.h (get_number, get_number_or_range): Move to cli-utils.h. * breakpoint.c: Include cli-utils.h. (get_number_trailer, get_number, get_number_or_range) (ep_skip_leading_whitespace): Move to cli-utils.c. (create_breakpoint_sal, find_condition_and_thread) (decode_static_tracepoint_spec, watch_command_1) (watch_maybe_just_location, ep_parse_optional_if_clause) (catch_fork_command_1, catch_exec_command_1) (catch_syscall_command_1): Use skip_spaces, skip_to_space. * Makefile.in (SUBDIR_CLI_OBS): Add cli-utils.o. (SUBDIR_CLI_SRCS): Add cli-utils.c. (HFILES_NO_SRCDIR): Add cli-utils.h. (cli-utils.o): New target.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r--gdb/printcmd.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index d89004b..ebca5a3 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -50,6 +50,7 @@
#include "charset.h"
#include "arch-utils.h"
#include "printcmd.h"
+#include "cli/cli-utils.h"
#ifdef TUI
#include "tui/tui.h" /* For tui_active et al. */
@@ -1983,9 +1984,7 @@ string_printf (char *arg, struct ui_file *stream, printf_callback callback,
if (s == 0)
error_no_arg (_("format-control string and values to print"));
- /* Skip white space before format string. */
- while (*s == ' ' || *s == '\t')
- s++;
+ s = skip_spaces (s);
/* A format string should follow, enveloped in double quotes. */
if (*s++ != '"')
@@ -2049,16 +2048,14 @@ string_printf (char *arg, struct ui_file *stream, printf_callback callback,
/* Skip over " and following space and comma. */
s++;
*f++ = '\0';
- while (*s == ' ' || *s == '\t')
- s++;
+ s = skip_spaces (s);
if (*s != ',' && *s != 0)
error (_("Invalid argument syntax"));
if (*s == ',')
s++;
- while (*s == ' ' || *s == '\t')
- s++;
+ s = skip_spaces (s);
/* Need extra space for the '\0's. Doubling the size is sufficient. */
substrings = alloca (strlen (string) * 2);