1 /* Python interface to breakpoints
3 Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 #include "exceptions.h"
23 #include "python-internal.h"
25 #include "breakpoint.h"
27 #include "gdbthread.h"
29 #include "cli/cli-script.h"
31 #include "arch-utils.h"
34 static PyTypeObject breakpoint_object_type;
36 /* Number of live breakpoints. */
39 /* Variables used to pass information between the Breakpoint
40 constructor and the breakpoint-created hook function. */
41 static breakpoint_object *bppy_pending_object;
43 /* Function that is called when a Python condition is evaluated. */
44 static char * const stop_func = "stop";
46 struct breakpoint_object
50 /* The breakpoint number according to gdb. */
53 /* The gdb breakpoint object, or NULL if the breakpoint has been
55 struct breakpoint *bp;
58 /* Require that BREAKPOINT be a valid breakpoint ID; throw a Python
59 exception if it is invalid. */
60 #define BPPY_REQUIRE_VALID(Breakpoint) \
62 if ((Breakpoint)->bp == NULL) \
63 return PyErr_Format (PyExc_RuntimeError, \
64 _("Breakpoint %d is invalid."), \
65 (Breakpoint)->number); \
68 /* Require that BREAKPOINT be a valid breakpoint ID; throw a Python
69 exception if it is invalid. This macro is for use in setter functions. */
70 #define BPPY_SET_REQUIRE_VALID(Breakpoint) \
72 if ((Breakpoint)->bp == NULL) \
74 PyErr_Format (PyExc_RuntimeError, _("Breakpoint %d is invalid."), \
75 (Breakpoint)->number); \
80 /* This is used to initialize various gdb.bp_* constants. */
89 /* Entries related to the type of user set breakpoints. */
90 static struct pybp_code pybp_codes[] =
92 { "BP_NONE", bp_none},
93 { "BP_BREAKPOINT", bp_breakpoint},
94 { "BP_WATCHPOINT", bp_watchpoint},
95 { "BP_HARDWARE_WATCHPOINT", bp_hardware_watchpoint},
96 { "BP_READ_WATCHPOINT", bp_read_watchpoint},
97 { "BP_ACCESS_WATCHPOINT", bp_access_watchpoint},
98 {NULL} /* Sentinel. */
101 /* Entries related to the type of watchpoint. */
102 static struct pybp_code pybp_watch_types[] =
104 { "WP_READ", hw_read},
105 { "WP_WRITE", hw_write},
106 { "WP_ACCESS", hw_access},
107 {NULL} /* Sentinel. */
110 /* Python function which checks the validity of a breakpoint object. */
112 bppy_is_valid (PyObject *self, PyObject *args)
114 breakpoint_object *self_bp = (breakpoint_object *) self;
121 /* Python function to test whether or not the breakpoint is enabled. */
123 bppy_get_enabled (PyObject *self, void *closure)
125 breakpoint_object *self_bp = (breakpoint_object *) self;
127 BPPY_REQUIRE_VALID (self_bp);
130 if (self_bp->bp->enable_state == bp_enabled)
135 /* Python function to test whether or not the breakpoint is silent. */
137 bppy_get_silent (PyObject *self, void *closure)
139 breakpoint_object *self_bp = (breakpoint_object *) self;
141 BPPY_REQUIRE_VALID (self_bp);
142 if (self_bp->bp->silent)
147 /* Python function to set the enabled state of a breakpoint. */
149 bppy_set_enabled (PyObject *self, PyObject *newvalue, void *closure)
151 breakpoint_object *self_bp = (breakpoint_object *) self;
153 volatile struct gdb_exception except;
155 BPPY_SET_REQUIRE_VALID (self_bp);
157 if (newvalue == NULL)
159 PyErr_SetString (PyExc_TypeError,
160 _("Cannot delete `enabled' attribute."));
164 else if (! PyBool_Check (newvalue))
166 PyErr_SetString (PyExc_TypeError,
167 _("The value of `enabled' must be a boolean."));
171 cmp = PyObject_IsTrue (newvalue);
175 TRY_CATCH (except, RETURN_MASK_ALL)
178 enable_breakpoint (self_bp->bp);
180 disable_breakpoint (self_bp->bp);
182 GDB_PY_SET_HANDLE_EXCEPTION (except);
187 /* Python function to set the 'silent' state of a breakpoint. */
189 bppy_set_silent (PyObject *self, PyObject *newvalue, void *closure)
191 breakpoint_object *self_bp = (breakpoint_object *) self;
194 BPPY_SET_REQUIRE_VALID (self_bp);
196 if (newvalue == NULL)
198 PyErr_SetString (PyExc_TypeError,
199 _("Cannot delete `silent' attribute."));
202 else if (! PyBool_Check (newvalue))
204 PyErr_SetString (PyExc_TypeError,
205 _("The value of `silent' must be a boolean."));
209 cmp = PyObject_IsTrue (newvalue);
213 breakpoint_set_silent (self_bp->bp, cmp);
218 /* Python function to set the thread of a breakpoint. */
220 bppy_set_thread (PyObject *self, PyObject *newvalue, void *closure)
222 breakpoint_object *self_bp = (breakpoint_object *) self;
225 BPPY_SET_REQUIRE_VALID (self_bp);
227 if (newvalue == NULL)
229 PyErr_SetString (PyExc_TypeError,
230 _("Cannot delete `thread' attribute."));
233 else if (PyInt_Check (newvalue))
235 if (! gdb_py_int_as_long (newvalue, &id))
238 if (! valid_thread_id (id))
240 PyErr_SetString (PyExc_RuntimeError,
241 _("Invalid thread ID."));
245 else if (newvalue == Py_None)
249 PyErr_SetString (PyExc_TypeError,
250 _("The value of `thread' must be an integer or None."));
254 breakpoint_set_thread (self_bp->bp, id);
259 /* Python function to set the (Ada) task of a breakpoint. */
261 bppy_set_task (PyObject *self, PyObject *newvalue, void *closure)
263 breakpoint_object *self_bp = (breakpoint_object *) self;
266 volatile struct gdb_exception except;
268 BPPY_SET_REQUIRE_VALID (self_bp);
270 if (newvalue == NULL)
272 PyErr_SetString (PyExc_TypeError,
273 _("Cannot delete `task' attribute."));
276 else if (PyInt_Check (newvalue))
278 if (! gdb_py_int_as_long (newvalue, &id))
281 TRY_CATCH (except, RETURN_MASK_ALL)
283 valid_id = valid_task_id (id);
285 GDB_PY_SET_HANDLE_EXCEPTION (except);
289 PyErr_SetString (PyExc_RuntimeError,
290 _("Invalid task ID."));
294 else if (newvalue == Py_None)
298 PyErr_SetString (PyExc_TypeError,
299 _("The value of `task' must be an integer or None."));
303 breakpoint_set_task (self_bp->bp, id);
308 /* Python function which deletes the underlying GDB breakpoint. This
309 triggers the breakpoint_deleted observer which will call
310 gdbpy_breakpoint_deleted; that function cleans up the Python
314 bppy_delete_breakpoint (PyObject *self, PyObject *args)
316 breakpoint_object *self_bp = (breakpoint_object *) self;
317 volatile struct gdb_exception except;
319 BPPY_REQUIRE_VALID (self_bp);
321 TRY_CATCH (except, RETURN_MASK_ALL)
323 delete_breakpoint (self_bp->bp);
325 GDB_PY_HANDLE_EXCEPTION (except);
331 /* Python function to set the ignore count of a breakpoint. */
333 bppy_set_ignore_count (PyObject *self, PyObject *newvalue, void *closure)
335 breakpoint_object *self_bp = (breakpoint_object *) self;
338 BPPY_SET_REQUIRE_VALID (self_bp);
340 if (newvalue == NULL)
342 PyErr_SetString (PyExc_TypeError,
343 _("Cannot delete `ignore_count' attribute."));
346 else if (! PyInt_Check (newvalue))
348 PyErr_SetString (PyExc_TypeError,
349 _("The value of `ignore_count' must be an integer."));
353 if (! gdb_py_int_as_long (newvalue, &value))
358 set_ignore_count (self_bp->number, (int) value, 0);
363 /* Python function to set the hit count of a breakpoint. */
365 bppy_set_hit_count (PyObject *self, PyObject *newvalue, void *closure)
367 breakpoint_object *self_bp = (breakpoint_object *) self;
369 BPPY_SET_REQUIRE_VALID (self_bp);
371 if (newvalue == NULL)
373 PyErr_SetString (PyExc_TypeError,
374 _("Cannot delete `hit_count' attribute."));
381 if (! gdb_py_int_as_long (newvalue, &value))
386 PyErr_SetString (PyExc_AttributeError,
387 _("The value of `hit_count' must be zero."));
392 self_bp->bp->hit_count = 0;
397 /* Python function to get the location of a breakpoint. */
399 bppy_get_location (PyObject *self, void *closure)
402 breakpoint_object *obj = (breakpoint_object *) self;
404 BPPY_REQUIRE_VALID (obj);
406 if (obj->bp->type != bp_breakpoint)
409 str = obj->bp->addr_string;
413 return PyString_Decode (str, strlen (str), host_charset (), NULL);
416 /* Python function to get the breakpoint expression. */
418 bppy_get_expression (PyObject *self, void *closure)
421 breakpoint_object *obj = (breakpoint_object *) self;
422 struct watchpoint *wp;
424 BPPY_REQUIRE_VALID (obj);
426 if (!is_watchpoint (obj->bp))
429 wp = (struct watchpoint *) obj->bp;
431 str = wp->exp_string;
435 return PyString_Decode (str, strlen (str), host_charset (), NULL);
438 /* Python function to get the condition expression of a breakpoint. */
440 bppy_get_condition (PyObject *self, void *closure)
443 breakpoint_object *obj = (breakpoint_object *) self;
445 BPPY_REQUIRE_VALID (obj);
447 str = obj->bp->cond_string;
451 return PyString_Decode (str, strlen (str), host_charset (), NULL);
454 /* Returns 0 on success. Returns -1 on error, with a python exception set.
458 bppy_set_condition (PyObject *self, PyObject *newvalue, void *closure)
461 breakpoint_object *self_bp = (breakpoint_object *) self;
462 volatile struct gdb_exception except;
464 BPPY_SET_REQUIRE_VALID (self_bp);
466 if (newvalue == NULL)
468 PyErr_SetString (PyExc_TypeError,
469 _("Cannot delete `condition' attribute."));
472 else if (newvalue == Py_None)
476 exp = python_string_to_host_string (newvalue);
481 TRY_CATCH (except, RETURN_MASK_ALL)
483 set_breakpoint_condition (self_bp->bp, exp, 0);
486 if (newvalue != Py_None)
489 GDB_PY_SET_HANDLE_EXCEPTION (except);
494 /* Python function to get the commands attached to a breakpoint. */
496 bppy_get_commands (PyObject *self, void *closure)
498 breakpoint_object *self_bp = (breakpoint_object *) self;
499 struct breakpoint *bp = self_bp->bp;
501 volatile struct gdb_exception except;
502 struct ui_file *string_file;
503 struct cleanup *chain;
507 BPPY_REQUIRE_VALID (self_bp);
509 if (! self_bp->bp->commands)
512 string_file = mem_fileopen ();
513 chain = make_cleanup_ui_file_delete (string_file);
515 ui_out_redirect (current_uiout, string_file);
516 TRY_CATCH (except, RETURN_MASK_ALL)
518 print_command_lines (current_uiout, breakpoint_commands (bp), 0);
520 ui_out_redirect (current_uiout, NULL);
521 GDB_PY_HANDLE_EXCEPTION (except);
523 cmdstr = ui_file_xstrdup (string_file, &length);
524 make_cleanup (xfree, cmdstr);
525 result = PyString_Decode (cmdstr, strlen (cmdstr), host_charset (), NULL);
530 /* Python function to get the breakpoint type. */
532 bppy_get_type (PyObject *self, void *closure)
534 breakpoint_object *self_bp = (breakpoint_object *) self;
536 BPPY_REQUIRE_VALID (self_bp);
538 return PyInt_FromLong (self_bp->bp->type);
541 /* Python function to get the visibility of the breakpoint. */
544 bppy_get_visibility (PyObject *self, void *closure)
546 breakpoint_object *self_bp = (breakpoint_object *) self;
548 BPPY_REQUIRE_VALID (self_bp);
550 if (self_bp->bp->number < 0)
556 /* Python function to get the breakpoint's number. */
558 bppy_get_number (PyObject *self, void *closure)
560 breakpoint_object *self_bp = (breakpoint_object *) self;
562 BPPY_REQUIRE_VALID (self_bp);
564 return PyInt_FromLong (self_bp->number);
567 /* Python function to get the breakpoint's thread ID. */
569 bppy_get_thread (PyObject *self, void *closure)
571 breakpoint_object *self_bp = (breakpoint_object *) self;
573 BPPY_REQUIRE_VALID (self_bp);
575 if (self_bp->bp->thread == -1)
578 return PyInt_FromLong (self_bp->bp->thread);
581 /* Python function to get the breakpoint's task ID (in Ada). */
583 bppy_get_task (PyObject *self, void *closure)
585 breakpoint_object *self_bp = (breakpoint_object *) self;
587 BPPY_REQUIRE_VALID (self_bp);
589 if (self_bp->bp->task == 0)
592 return PyInt_FromLong (self_bp->bp->task);
595 /* Python function to get the breakpoint's hit count. */
597 bppy_get_hit_count (PyObject *self, void *closure)
599 breakpoint_object *self_bp = (breakpoint_object *) self;
601 BPPY_REQUIRE_VALID (self_bp);
603 return PyInt_FromLong (self_bp->bp->hit_count);
606 /* Python function to get the breakpoint's ignore count. */
608 bppy_get_ignore_count (PyObject *self, void *closure)
610 breakpoint_object *self_bp = (breakpoint_object *) self;
612 BPPY_REQUIRE_VALID (self_bp);
614 return PyInt_FromLong (self_bp->bp->ignore_count);
617 /* Python function to create a new breakpoint. */
619 bppy_init (PyObject *self, PyObject *args, PyObject *kwargs)
621 static char *keywords[] = { "spec", "type", "wp_class", "internal", NULL };
623 int type = bp_breakpoint;
624 int access_type = hw_write;
625 PyObject *internal = NULL;
627 volatile struct gdb_exception except;
629 if (! PyArg_ParseTupleAndKeywords (args, kwargs, "s|iiO", keywords,
630 &spec, &type, &access_type, &internal))
635 internal_bp = PyObject_IsTrue (internal);
636 if (internal_bp == -1)
640 bppy_pending_object = (breakpoint_object *) self;
641 bppy_pending_object->number = -1;
642 bppy_pending_object->bp = NULL;
644 TRY_CATCH (except, RETURN_MASK_ALL)
646 char *copy = xstrdup (spec);
647 struct cleanup *cleanup = make_cleanup (xfree, copy);
653 create_breakpoint (python_gdbarch,
659 &bkpt_breakpoint_ops,
665 if (access_type == hw_write)
666 watch_command_wrapper (copy, 0, internal_bp);
667 else if (access_type == hw_access)
668 awatch_command_wrapper (copy, 0, internal_bp);
669 else if (access_type == hw_read)
670 rwatch_command_wrapper (copy, 0, internal_bp);
672 error(_("Cannot understand watchpoint access type."));
676 error(_("Do not understand breakpoint type to set."));
679 do_cleanups (cleanup);
681 if (except.reason < 0)
683 PyErr_Format (except.reason == RETURN_QUIT
684 ? PyExc_KeyboardInterrupt : PyExc_RuntimeError,
685 "%s", except.message);
689 BPPY_SET_REQUIRE_VALID ((breakpoint_object *) self);
696 build_bp_list (struct breakpoint *b, void *arg)
698 PyObject *list = arg;
699 PyObject *bp = (PyObject *) b->py_bp_object;
702 /* Not all breakpoints will have a companion Python object.
703 Only breakpoints that were created via bppy_new, or
704 breakpoints that were created externally and are tracked by
705 the Python Scripting API. */
707 iserr = PyList_Append (list, bp);
715 /* Static function to return a tuple holding all breakpoints. */
718 gdbpy_breakpoints (PyObject *self, PyObject *args)
720 PyObject *list, *tuple;
725 list = PyList_New (0);
729 /* If iteratre_over_breakpoints returns non NULL it signals an error
730 condition. In that case abandon building the list and return
732 if (iterate_over_breakpoints (build_bp_list, list) != NULL)
738 tuple = PyList_AsTuple (list);
744 /* Call the "stop" method (if implemented) in the breakpoint
745 class. If the method returns True, the inferior will be
746 stopped at the breakpoint. Otherwise the inferior will be
747 allowed to continue. */
750 gdbpy_should_stop (struct breakpoint_object *bp_obj)
754 PyObject *py_bp = (PyObject *) bp_obj;
755 struct breakpoint *b = bp_obj->bp;
756 struct gdbarch *garch = b->gdbarch ? b->gdbarch : get_current_arch ();
757 struct cleanup *cleanup = ensure_python_env (garch, current_language);
759 if (PyObject_HasAttrString (py_bp, stop_func))
761 PyObject *result = PyObject_CallMethod (py_bp, stop_func, NULL);
765 int evaluate = PyObject_IsTrue (result);
768 gdbpy_print_stack ();
770 /* If the "stop" function returns False that means
771 the Python breakpoint wants GDB to continue. */
778 gdbpy_print_stack ();
780 do_cleanups (cleanup);
785 /* Checks if the "stop" method exists in this breakpoint.
786 Used by condition_command to ensure mutual exclusion of breakpoint
790 gdbpy_breakpoint_has_py_cond (struct breakpoint_object *bp_obj)
793 PyObject *py_bp = (PyObject *) bp_obj;
794 struct gdbarch *garch = bp_obj->bp->gdbarch ? bp_obj->bp->gdbarch :
796 struct cleanup *cleanup = ensure_python_env (garch, current_language);
799 has_func = PyObject_HasAttrString (py_bp, stop_func);
801 do_cleanups (cleanup);
808 /* Event callback functions. */
810 /* Callback that is used when a breakpoint is created. This function
811 will create a new Python breakpoint object. */
813 gdbpy_breakpoint_created (struct breakpoint *bp)
815 breakpoint_object *newbp;
816 PyGILState_STATE state;
818 if (bp->number < 0 && bppy_pending_object == NULL)
821 if (bp->type != bp_breakpoint
822 && bp->type != bp_watchpoint
823 && bp->type != bp_hardware_watchpoint
824 && bp->type != bp_read_watchpoint
825 && bp->type != bp_access_watchpoint)
828 state = PyGILState_Ensure ();
830 if (bppy_pending_object)
832 newbp = bppy_pending_object;
833 bppy_pending_object = NULL;
836 newbp = PyObject_New (breakpoint_object, &breakpoint_object_type);
839 newbp->number = bp->number;
841 newbp->bp->py_bp_object = newbp;
847 PyErr_SetString (PyExc_RuntimeError,
848 _("Error while creating breakpoint from GDB."));
849 gdbpy_print_stack ();
852 PyGILState_Release (state);
855 /* Callback that is used when a breakpoint is deleted. This will
856 invalidate the corresponding Python object. */
858 gdbpy_breakpoint_deleted (struct breakpoint *b)
861 PyGILState_STATE state;
862 struct breakpoint *bp = NULL;
863 breakpoint_object *bp_obj;
865 state = PyGILState_Ensure ();
866 bp = get_breakpoint (num);
869 bp_obj = bp->py_bp_object;
877 PyGILState_Release (state);
882 /* Initialize the Python breakpoint code. */
884 gdbpy_initialize_breakpoints (void)
888 breakpoint_object_type.tp_new = PyType_GenericNew;
889 if (PyType_Ready (&breakpoint_object_type) < 0)
892 Py_INCREF (&breakpoint_object_type);
893 PyModule_AddObject (gdb_module, "Breakpoint",
894 (PyObject *) &breakpoint_object_type);
896 observer_attach_breakpoint_created (gdbpy_breakpoint_created);
897 observer_attach_breakpoint_deleted (gdbpy_breakpoint_deleted);
899 /* Add breakpoint types constants. */
900 for (i = 0; pybp_codes[i].name; ++i)
902 if (PyModule_AddIntConstant (gdb_module,
903 /* Cast needed for Python 2.4. */
904 (char *) pybp_codes[i].name,
905 pybp_codes[i].code) < 0)
909 /* Add watchpoint types constants. */
910 for (i = 0; pybp_watch_types[i].name; ++i)
912 if (PyModule_AddIntConstant (gdb_module,
913 /* Cast needed for Python 2.4. */
914 (char *) pybp_watch_types[i].name,
915 pybp_watch_types[i].code) < 0)
923 /* Helper function that overrides this Python object's
924 PyObject_GenericSetAttr to allow extra validation of the attribute
928 local_setattro (PyObject *self, PyObject *name, PyObject *v)
930 breakpoint_object *obj = (breakpoint_object *) self;
931 char *attr = python_string_to_host_string (name);
936 /* If the attribute trying to be set is the "stop" method,
937 but we already have a condition set in the CLI, disallow this
939 if (strcmp (attr, stop_func) == 0 && obj->bp->cond_string)
942 PyErr_SetString (PyExc_RuntimeError,
943 _("Cannot set 'stop' method. There is an " \
944 "existing GDB condition attached to the " \
951 return PyObject_GenericSetAttr ((PyObject *)self, name, v);
954 static PyGetSetDef breakpoint_object_getset[] = {
955 { "enabled", bppy_get_enabled, bppy_set_enabled,
956 "Boolean telling whether the breakpoint is enabled.", NULL },
957 { "silent", bppy_get_silent, bppy_set_silent,
958 "Boolean telling whether the breakpoint is silent.", NULL },
959 { "thread", bppy_get_thread, bppy_set_thread,
960 "Thread ID for the breakpoint.\n\
961 If the value is a thread ID (integer), then this is a thread-specific breakpoint.\n\
962 If the value is None, then this breakpoint is not thread-specific.\n\
963 No other type of value can be used.", NULL },
964 { "task", bppy_get_task, bppy_set_task,
965 "Thread ID for the breakpoint.\n\
966 If the value is a task ID (integer), then this is an Ada task-specific breakpoint.\n\
967 If the value is None, then this breakpoint is not task-specific.\n\
968 No other type of value can be used.", NULL },
969 { "ignore_count", bppy_get_ignore_count, bppy_set_ignore_count,
970 "Number of times this breakpoint should be automatically continued.",
972 { "number", bppy_get_number, NULL,
973 "Breakpoint's number assigned by GDB.", NULL },
974 { "hit_count", bppy_get_hit_count, bppy_set_hit_count,
975 "Number of times the breakpoint has been hit.\n\
976 Can be set to zero to clear the count. No other value is valid\n\
977 when setting this property.", NULL },
978 { "location", bppy_get_location, NULL,
979 "Location of the breakpoint, as specified by the user.", NULL},
980 { "expression", bppy_get_expression, NULL,
981 "Expression of the breakpoint, as specified by the user.", NULL},
982 { "condition", bppy_get_condition, bppy_set_condition,
983 "Condition of the breakpoint, as specified by the user,\
984 or None if no condition set."},
985 { "commands", bppy_get_commands, NULL,
986 "Commands of the breakpoint, as specified by the user."},
987 { "type", bppy_get_type, NULL,
988 "Type of breakpoint."},
989 { "visible", bppy_get_visibility, NULL,
990 "Whether the breakpoint is visible to the user."},
991 { NULL } /* Sentinel. */
994 static PyMethodDef breakpoint_object_methods[] =
996 { "is_valid", bppy_is_valid, METH_NOARGS,
997 "Return true if this breakpoint is valid, false if not." },
998 { "delete", bppy_delete_breakpoint, METH_NOARGS,
999 "Delete the underlying GDB breakpoint." },
1000 { NULL } /* Sentinel. */
1003 static PyTypeObject breakpoint_object_type =
1005 PyObject_HEAD_INIT (NULL)
1007 "gdb.Breakpoint", /*tp_name*/
1008 sizeof (breakpoint_object), /*tp_basicsize*/
1017 0, /*tp_as_sequence*/
1018 0, /*tp_as_mapping*/
1023 (setattrofunc)local_setattro, /*tp_setattro */
1025 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
1026 "GDB breakpoint object", /* tp_doc */
1027 0, /* tp_traverse */
1029 0, /* tp_richcompare */
1030 0, /* tp_weaklistoffset */
1032 0, /* tp_iternext */
1033 breakpoint_object_methods, /* tp_methods */
1035 breakpoint_object_getset, /* tp_getset */
1038 0, /* tp_descr_get */
1039 0, /* tp_descr_set */
1040 0, /* tp_dictoffset */
1041 bppy_init, /* tp_init */