Change extension language pretty-printers to use value API
[deliverable/binutils-gdb.git] / gdb / python / py-value.c
index 497696a7d3a8af7da55d5ed5de8f453e22b52b85..bc75a68326e620b0f357216cc5c1a3dfc6d47713 100644 (file)
@@ -1788,6 +1788,27 @@ value_to_value_object (struct value *val)
   return (PyObject *) val_obj;
 }
 
+/* Returns an object for a value, but without releasing it from the
+   all_values chain.  */
+PyObject *
+value_to_value_object_no_release (struct value *val)
+{
+  value_object *val_obj;
+
+  val_obj = PyObject_New (value_object, &value_object_type);
+  if (val_obj != NULL)
+    {
+      value_incref (val);
+      val_obj->value = val;
+      val_obj->address = NULL;
+      val_obj->type = NULL;
+      val_obj->dynamic_type = NULL;
+      note_value (val_obj);
+    }
+
+  return (PyObject *) val_obj;
+}
+
 /* Returns a borrowed reference to the struct value corresponding to
    the given value object.  */
 struct value *
This page took 0.023467 seconds and 4 git commands to generate.