gdb/python/py-events.h - gdb

Data types defined

Macros defined

Source code

  1. /* Python interface to inferior events.

  2.    Copyright (C) 2009-2015 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. #ifndef GDB_PY_EVENTS_H
  15. #define GDB_PY_EVENTS_H

  16. #include "command.h"
  17. #include "python-internal.h"
  18. #include "inferior.h"

  19. extern PyTypeObject thread_event_object_type
  20.     CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("event_object");

  21. /* Stores a list of objects to be notified when the event for which this
  22.    registry tracks occurs.  */

  23. typedef struct
  24. {
  25.   PyObject_HEAD

  26.   PyObject *callbacks;
  27. } eventregistry_object;

  28. /* Struct holding references to event registries both in python and c.
  29.    This is meant to be a singleton.  */

  30. typedef struct
  31. {
  32.   eventregistry_object *stop;
  33.   eventregistry_object *cont;
  34.   eventregistry_object *exited;
  35.   eventregistry_object *new_objfile;
  36.   eventregistry_object *clear_objfiles;
  37.   eventregistry_object *inferior_call;
  38.   eventregistry_object *memory_changed;
  39.   eventregistry_object *register_changed;

  40.   PyObject *module;

  41. } events_object;

  42. /* Python events singleton.  */
  43. extern events_object gdb_py_events;

  44. extern eventregistry_object *create_eventregistry_object (void);
  45. extern int evregpy_no_listeners_p (eventregistry_object *registry);

  46. #endif /* GDB_PY_EVENTS_H */