GDB (API)
/home/stan/gdb/src/gdb/mi/mi-parse.h
Go to the documentation of this file.
00001 /* MI Command Set - MI Command Parser.
00002    Copyright (C) 2000-2013 Free Software Foundation, Inc.
00003    Contributed by Cygnus Solutions (a Red Hat company).
00004 
00005    This file is part of GDB.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 3 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 #ifndef MI_PARSE_H
00021 #define MI_PARSE_H
00022 
00023 #include <sys/time.h>
00024 
00025 /* MI parser */
00026 
00027 /* Timestamps for current command and last asynchronous command.  */
00028 struct mi_timestamp {
00029   struct timeval wallclock;
00030   struct timeval utime;
00031   struct timeval stime;
00032 };
00033 
00034 enum mi_command_type
00035   {
00036     MI_COMMAND, CLI_COMMAND
00037   };
00038 
00039 struct mi_parse
00040   {
00041     enum mi_command_type op;
00042     char *command;
00043     char *token;
00044     const struct mi_cmd *cmd;
00045     struct mi_timestamp *cmd_start;
00046     char *args;
00047     char **argv;
00048     int argc;
00049     int all;
00050     int thread_group; /* At present, the same as inferior number.  */
00051     int thread;
00052     int frame;
00053   };
00054 
00055 /* Attempts to parse CMD returning a ``struct mi_parse''.  If CMD is
00056    invalid, an exception is thrown.  For an MI_COMMAND COMMAND, ARGS
00057    and OP are initialized.  Un-initialized fields are zero.  *TOKEN is
00058    set to the token, even if an exception is thrown.  It is allocated
00059    with xmalloc; it must either be freed with xfree, or assigned to
00060    the TOKEN field of the resultant mi_parse object, to be freed by
00061    mi_parse_free.  */
00062 
00063 extern struct mi_parse *mi_parse (const char *cmd, char **token);
00064 
00065 /* Free a command returned by mi_parse_command.  */
00066 
00067 extern void mi_parse_free (struct mi_parse *cmd);
00068 
00069 /* Parse a string argument into a print_values value.  */
00070 
00071 enum print_values mi_parse_print_values (const char *name);
00072 
00073 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines