aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/cli/cli-utils.h')
-rw-r--r--gdb/cli/cli-utils.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/cli/cli-utils.h b/gdb/cli/cli-utils.h
index 9425fb4..41c2356 100644
--- a/gdb/cli/cli-utils.h
+++ b/gdb/cli/cli-utils.h
@@ -39,6 +39,10 @@ extern int get_number (const char **);
extern int get_number (char **);
+/* Like get_number_trailer, but works with ULONGEST, and throws on
+ error instead of returning 0. */
+extern ULONGEST get_ulongest (const char **pp, int trailer = '\0');
+
/* Extract from ARGS the arguments [-q] [-t TYPEREGEXP] [--] NAMEREGEXP.
The caller is responsible to initialize *QUIET to false, *REGEXP
@@ -193,6 +197,14 @@ extern std::string extract_arg (const char **arg);
argument. */
extern int check_for_argument (const char **str, const char *arg, int arg_len);
+/* Same as above, but ARG's length is computed. */
+
+static inline int
+check_for_argument (const char **str, const char *arg)
+{
+ return check_for_argument (str, arg, strlen (arg));
+}
+
/* Same, for non-const STR. */
static inline int
@@ -202,6 +214,12 @@ check_for_argument (char **str, const char *arg, int arg_len)
arg, arg_len);
}
+static inline int
+check_for_argument (char **str, const char *arg)
+{
+ return check_for_argument (str, arg, strlen (arg));
+}
+
/* A helper function that looks for a set of flags at the start of a
string. The possible flags are given as a null terminated string.
A flag in STR must either be at the end of the string,