GDB (API)
/home/stan/gdb/src/gdb/python/py-events.h
Go to the documentation of this file.
00001 /* Python interface to inferior events.
00002 
00003    Copyright (C) 2009-2013 Free Software Foundation, Inc.
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 GDB_PY_EVENTS_H
00021 #define GDB_PY_EVENTS_H
00022 
00023 #include "command.h"
00024 #include "python-internal.h"
00025 #include "inferior.h"
00026 
00027 extern PyTypeObject thread_event_object_type
00028     CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("event_object");
00029 
00030 /* Stores a list of objects to be notified when the event for which this
00031    registry tracks occurs.  */
00032 
00033 typedef struct
00034 {
00035   PyObject_HEAD
00036 
00037   PyObject *callbacks;
00038 } eventregistry_object;
00039 
00040 /* Struct holding references to event registries both in python and c.
00041    This is meant to be a singleton.  */
00042 
00043 typedef struct
00044 {
00045   eventregistry_object *stop;
00046   eventregistry_object *cont;
00047   eventregistry_object *exited;
00048   eventregistry_object *new_objfile;
00049 
00050   PyObject *module;
00051 
00052 } events_object;
00053 
00054 /* Python events singleton.  */
00055 extern events_object gdb_py_events;
00056 
00057 extern eventregistry_object *create_eventregistry_object (void);
00058 extern int evregpy_no_listeners_p (eventregistry_object *registry);
00059 
00060 #endif /* GDB_PY_EVENTS_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines