GDB (API)
/home/stan/gdb/src/gdb/python/py-continueevent.c
Go to the documentation of this file.
00001 /* Python interface to inferior continue 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 #include "defs.h"
00021 #include "py-event.h"
00022 
00023 static PyTypeObject continue_event_object_type
00024     CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("event_object");
00025 
00026 static PyObject *
00027 create_continue_event_object (void)
00028 {
00029   return create_thread_event_object (&continue_event_object_type);
00030 }
00031 
00032 /* Callback function which notifies observers when a continue event occurs.
00033    This function will create a new Python continue event object.
00034    Return -1 if emit fails.  */
00035 
00036 int
00037 emit_continue_event (ptid_t ptid)
00038 {
00039   PyObject *event;
00040 
00041   if (evregpy_no_listeners_p (gdb_py_events.cont))
00042     return 0;
00043 
00044   event = create_continue_event_object ();
00045   if (event)
00046     return evpy_emit_event (event, gdb_py_events.cont);
00047   return -1;
00048 }
00049 
00050 GDBPY_NEW_EVENT_TYPE (continue,
00051                       "gdb.ContinueEvent",
00052                       "ContinueEvent",
00053                       "GDB continue event object",
00054                       thread_event_object_type,
00055                       static);
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines