+/* Helper function that overrides this Python object's
+ PyObject_GenericSetAttr to allow extra validation of the attribute
+ being set. */
+
+static int
+local_setattro (PyObject *self, PyObject *name, PyObject *v)
+{
+ gdbpy_breakpoint_object *obj = (gdbpy_breakpoint_object *) self;
+ gdb::unique_xmalloc_ptr<char> attr (python_string_to_host_string (name));
+
+ if (attr == NULL)
+ return -1;
+
+ /* If the attribute trying to be set is the "stop" method,
+ but we already have a condition set in the CLI or other extension
+ language, disallow this operation. */
+ if (strcmp (attr.get (), stop_func) == 0)
+ {
+ const struct extension_language_defn *extlang = NULL;
+
+ if (obj->bp->cond_string != NULL)
+ extlang = get_ext_lang_defn (EXT_LANG_GDB);
+ if (extlang == NULL)
+ extlang = get_breakpoint_cond_ext_lang (obj->bp, EXT_LANG_PYTHON);
+ if (extlang != NULL)
+ {
+ std::string error_text
+ = string_printf (_("Only one stop condition allowed. There is"
+ " currently a %s stop condition defined for"
+ " this breakpoint."),
+ ext_lang_capitalized_name (extlang));
+ PyErr_SetString (PyExc_RuntimeError, error_text.c_str ());
+ return -1;
+ }
+ }
+
+ return PyObject_GenericSetAttr ((PyObject *)self, name, v);
+}
+
+static gdb_PyGetSetDef breakpoint_object_getset[] = {