aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-parse.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2013-06-03 03:16:24 +0000
committerYao Qi <yao@codesourcery.com>2013-06-03 03:16:24 +0000
commit87967e273fc2c3c801869e6a57608aa82e8e4514 (patch)
treeafc35151321c6d4b107348c1b16aa7d12126e48b /gdb/mi/mi-parse.c
parent0a59cc46ca1f0c610c21c0014857ba0b097e7cdf (diff)
downloadgdb-87967e273fc2c3c801869e6a57608aa82e8e4514.zip
gdb-87967e273fc2c3c801869e6a57608aa82e8e4514.tar.gz
gdb-87967e273fc2c3c801869e6a57608aa82e8e4514.tar.bz2
gdb/
* mi/mi-cmd-var.c (mi_no_values, mi_simple_values): Move to mi-parse.c. Make them static. (mi_all_values): Likewise. (mi_parse_values_option): Move to mi-parse.c. Rename it to mi_parse_print_values. Make it external. * mi/mi-cmds.h (mi_no_values, mi_simple_values, mi_all_values): Remove the declarations. * mi/mi-parse.c (mi_parse_print_values): Moved from mi-cmd-var.c. * mi/mi-parse.h (mi_parse_print_values): Declare. * mi/mi-cmd-stack.c: Include mi-parse.h. (parse_print_values): Remove (mi_cmd_stack_list_locals): Call mi_parse_print_values instead of parse_print_values. (mi_cmd_stack_list_args, mi_cmd_stack_list_variables): Likewise.
Diffstat (limited to 'gdb/mi/mi-parse.c')
-rw-r--r--gdb/mi/mi-parse.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c
index 15fb778..0f35f1d 100644
--- a/gdb/mi/mi-parse.c
+++ b/gdb/mi/mi-parse.c
@@ -28,6 +28,10 @@
#include "gdb_string.h"
#include "cli/cli-utils.h"
+const static char mi_no_values[] = "--no-values";
+const static char mi_simple_values[] = "--simple-values";
+const static char mi_all_values[] = "--all-values";
+
/* Like parse_escape, but leave the results as a host char, not a
target char. */
@@ -373,3 +377,21 @@ mi_parse (const char *cmd, char **token)
parse->op = MI_COMMAND;
return parse;
}
+
+enum print_values
+mi_parse_print_values (const char *name)
+{
+ if (strcmp (name, "0") == 0
+ || strcmp (name, mi_no_values) == 0)
+ return PRINT_NO_VALUES;
+ else if (strcmp (name, "1") == 0
+ || strcmp (name, mi_all_values) == 0)
+ return PRINT_ALL_VALUES;
+ else if (strcmp (name, "2") == 0
+ || strcmp (name, mi_simple_values) == 0)
+ return PRINT_SIMPLE_VALUES;
+ else
+ error (_("Unknown value for PRINT_VALUES: must be: \
+0 or \"%s\", 1 or \"%s\", 2 or \"%s\""),
+ mi_no_values, mi_all_values, mi_simple_values);
+}