aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-parse.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-12-09 19:23:49 +0000
committerTom Tromey <tromey@redhat.com>2010-12-09 19:23:49 +0000
commit305aeedc41771066e7283a798b108c95b027997e (patch)
treed70f4243ed04ef7a18ff2553a8b93c98ea200c20 /gdb/mi/mi-parse.h
parent90ecf1736cbde5d0ca94914e52a765d3ca01e5f5 (diff)
downloadgdb-305aeedc41771066e7283a798b108c95b027997e.zip
gdb-305aeedc41771066e7283a798b108c95b027997e.tar.gz
gdb-305aeedc41771066e7283a798b108c95b027997e.tar.bz2
gdb
* mi/mi-parse.h (mi_parse): Update. * mi/mi-parse.c (mi_parse_cleanup): New function. (mi_parse): Add 'token' argument. Throw exception on error. * mi/mi-main.c (mi_print_exception): New function. (mi_execute_command): Use mi_print_exception. Catch exceptions from mi_parse. gdb/testsuite * gdb.base/interp.exp: Add regression test.
Diffstat (limited to 'gdb/mi/mi-parse.h')
-rw-r--r--gdb/mi/mi-parse.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/gdb/mi/mi-parse.h b/gdb/mi/mi-parse.h
index 3c6cd9a..6d0f53c 100644
--- a/gdb/mi/mi-parse.h
+++ b/gdb/mi/mi-parse.h
@@ -52,13 +52,15 @@ struct mi_parse
int frame;
};
-/* Attempts to parse CMD returning a ``struct mi_command''. If CMD is
- invalid, an error mesage is reported (MI format) and NULL is
- returned. For a CLI_COMMAND, COMMAND, TOKEN and OP are initialized.
- For an MI_COMMAND COMMAND, TOKEN, ARGS and OP are
- initialized. Un-initialized fields are zero. */
+/* Attempts to parse CMD returning a ``struct mi_parse''. If CMD is
+ invalid, an exception is thrown. For an MI_COMMAND COMMAND, ARGS
+ and OP are initialized. Un-initialized fields are zero. *TOKEN is
+ set to the token, even if an exception is thrown. It is allocated
+ with xmalloc; it must either be freed with xfree, or assigned to
+ the TOKEN field of the resultant mi_parse object, to be freed by
+ mi_parse_free. */
-extern struct mi_parse *mi_parse (char *cmd);
+extern struct mi_parse *mi_parse (char *cmd, char **token);
/* Free a command returned by mi_parse_command. */