gdb/mi/mi-parse.h - gdb

Data types defined

Macros defined

Source code

  1. /* MI Command Set - MI Command Parser.
  2.    Copyright (C) 2000-2015 Free Software Foundation, Inc.
  3.    Contributed by Cygnus Solutions (a Red Hat company).

  4.    This file is part of GDB.

  5.    This program is free software; you can redistribute it and/or modify
  6.    it under the terms of the GNU General Public License as published by
  7.    the Free Software Foundation; either version 3 of the License, or
  8.    (at your option) any later version.

  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.

  13.    You should have received a copy of the GNU General Public License
  14.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  15. #ifndef MI_PARSE_H
  16. #define MI_PARSE_H

  17. #include <sys/time.h>

  18. /* MI parser */

  19. /* Timestamps for current command and last asynchronous command.  */
  20. struct mi_timestamp {
  21.   struct timeval wallclock;
  22.   struct timeval utime;
  23.   struct timeval stime;
  24. };

  25. enum mi_command_type
  26.   {
  27.     MI_COMMAND, CLI_COMMAND
  28.   };

  29. struct mi_parse
  30.   {
  31.     enum mi_command_type op;
  32.     char *command;
  33.     char *token;
  34.     const struct mi_cmd *cmd;
  35.     struct mi_timestamp *cmd_start;
  36.     char *args;
  37.     char **argv;
  38.     int argc;
  39.     int all;
  40.     int thread_group; /* At present, the same as inferior number.  */
  41.     int thread;
  42.     int frame;

  43.     /* The language that should be used to evaluate the MI command.
  44.        Ignored if set to language_unknown.  */
  45.     enum language language;
  46.   };

  47. /* Attempts to parse CMD returning a ``struct mi_parse''.  If CMD is
  48.    invalid, an exception is thrown.  For an MI_COMMAND COMMAND, ARGS
  49.    and OP are initialized.  Un-initialized fields are zero.  *TOKEN is
  50.    set to the token, even if an exception is thrown.  It is allocated
  51.    with xmalloc; it must either be freed with xfree, or assigned to
  52.    the TOKEN field of the resultant mi_parse object, to be freed by
  53.    mi_parse_free.  */

  54. extern struct mi_parse *mi_parse (const char *cmd, char **token);

  55. /* Free a command returned by mi_parse_command.  */

  56. extern void mi_parse_free (struct mi_parse *cmd);

  57. /* Parse a string argument into a print_values value.  */

  58. enum print_values mi_parse_print_values (const char *name);

  59. #endif