GDB (API)
/home/stan/gdb/src/gdb/python/py-bpevent.c
Go to the documentation of this file.
00001 /* Python interface to inferior breakpoint stop 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-stopevent.h"
00022 
00023 static PyTypeObject breakpoint_event_object_type
00024     CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("event_object");
00025 
00026 /* Create and initialize a BreakpointEvent object.  This acquires new
00027    references to BREAKPOINT_LIST and FIRST_BP.  */
00028 
00029 PyObject *
00030 create_breakpoint_event_object (PyObject *breakpoint_list, PyObject *first_bp)
00031 {
00032   PyObject *breakpoint_event_obj =
00033       create_stop_event_object (&breakpoint_event_object_type);
00034 
00035   if (!breakpoint_event_obj)
00036     goto fail;
00037 
00038   if (evpy_add_attribute (breakpoint_event_obj,
00039                           "breakpoint",
00040                           first_bp) < 0)
00041     goto fail;
00042   if (evpy_add_attribute (breakpoint_event_obj,
00043                           "breakpoints",
00044                           breakpoint_list) < 0)
00045     goto fail;
00046 
00047   return breakpoint_event_obj;
00048 
00049  fail:
00050   Py_XDECREF (breakpoint_event_obj);
00051   return NULL;
00052 }
00053 
00054 GDBPY_NEW_EVENT_TYPE (breakpoint,
00055                       "gdb.BreakpointEvent",
00056                       "BreakpointEvent",
00057                       "GDB breakpoint stop event object",
00058                       stop_event_object_type,
00059                       static);
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines