(_initialize_python): Initialize it.
* python/python-internal.h (gdbpy_value_cst): Declare.
* python/py-value.c (convert_value_from_python): Use
gdbpy_value_cst.
+2011-02-28 Tom Tromey <tromey@redhat.com>
+
+ * python/python.c (gdbpy_value_cst): New global.
+ (_initialize_python): Initialize it.
+ * python/python-internal.h (gdbpy_value_cst): Declare.
+ * python/py-value.c (convert_value_from_python): Use
+ gdbpy_value_cst.
+
2011-02-28 Michael Snyder <msnyder@vmware.com>
* python/py-cmd.c (cmdpy_init): Fix memory leak.
else if (gdbpy_is_lazy_string (obj))
{
PyObject *result;
- PyObject *function = PyString_FromString ("value");
- result = PyObject_CallMethodObjArgs (obj, function, NULL);
+ result = PyObject_CallMethodObjArgs (obj, gdbpy_value_cst, NULL);
value = value_copy (((value_object *) result)->value);
}
else
extern PyObject *gdbpy_to_string_cst;
extern PyObject *gdbpy_display_hint_cst;
extern PyObject *gdbpy_enabled_cst;
+extern PyObject *gdbpy_value_cst;
/* Exception types. */
extern PyObject *gdbpy_gdb_error;
PyObject *gdbpy_display_hint_cst;
PyObject *gdbpy_doc_cst;
PyObject *gdbpy_enabled_cst;
+PyObject *gdbpy_value_cst;
/* The GdbError exception. */
PyObject *gdbpy_gdberror_exc;
gdbpy_display_hint_cst = PyString_FromString ("display_hint");
gdbpy_doc_cst = PyString_FromString ("__doc__");
gdbpy_enabled_cst = PyString_FromString ("enabled");
+ gdbpy_value_cst = PyString_FromString ("value");
/* Release the GIL while gdb runs. */
PyThreadState_Swap (NULL);