stap-probe.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* SystemTap probe support for GDB.
  2. Copyright (C) 2012-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #if !defined (STAP_PROBE_H)
  15. #define STAP_PROBE_H 1
  16. #include "parser-defs.h"
  17. /* Structure which holds information about the parsing process of one probe's
  18. argument. */
  19. struct stap_parse_info
  20. {
  21. stap_parse_info (const char *arg_, struct type *arg_type_,
  22. const struct language_defn *lang,
  23. struct gdbarch *gdbarch)
  24. : arg (arg_),
  25. pstate (lang, gdbarch),
  26. saved_arg (arg_),
  27. arg_type (arg_type_),
  28. gdbarch (gdbarch),
  29. inside_paren_p (0)
  30. {
  31. }
  32. DISABLE_COPY_AND_ASSIGN (stap_parse_info);
  33. /* The probe's argument in a string format. */
  34. const char *arg;
  35. /* The parser state to be used when generating the expression. */
  36. struct expr_builder pstate;
  37. /* A pointer to the full chain of arguments. This is useful for printing
  38. error messages. The parser functions should not modify this argument
  39. directly; instead, they should use the ARG pointer above. */
  40. const char *saved_arg;
  41. /* The expected argument type (bitness), as defined in the probe's
  42. argument. For instance, if the argument begins with `-8@', it means
  43. the bitness is 64-bit signed. In this case, ARG_TYPE would represent
  44. the type `int64_t'. */
  45. struct type *arg_type;
  46. /* A pointer to the current gdbarch. */
  47. struct gdbarch *gdbarch;
  48. /* Greater than zero if we are inside a parenthesized expression. Useful
  49. for knowing when to skip spaces or not. */
  50. int inside_paren_p;
  51. };
  52. #endif /* !defined (STAP_PROBE_H) */