]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/python: use gdbpy_is_value_object in more places
authoroltolm <oleg.tolmatcev@gmail.com>
Sat, 24 Jan 2026 12:23:49 +0000 (13:23 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Tue, 27 Jan 2026 09:40:43 +0000 (09:40 +0000)
Make more use of gdbpy_is_value_object in python/py-value.c

Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/python/py-value.c

index 6c28f13a3de44309fe5f6aad985e87d2b20cdf09..f6fdb7e508064682a2a51ab993c87633fd7bba40 100644 (file)
@@ -2000,7 +2000,7 @@ value_object_to_value (PyObject *self)
 {
   value_object *real;
 
-  if (! PyObject_TypeCheck (self, &value_object_type))
+  if (!gdbpy_is_value_object (self))
     return NULL;
   real = (value_object *) self;
   return real->value;
@@ -2073,7 +2073,7 @@ convert_value_from_python (PyObject *obj)
              = current_language->value_string (gdbpy_enter::get_gdbarch (),
                                                s.get (), strlen (s.get ()));
        }
-      else if (PyObject_TypeCheck (obj, &value_object_type))
+      else if (gdbpy_is_value_object (obj))
        value = ((value_object *) obj)->value->copy ();
       else if (gdbpy_is_lazy_string (obj))
        {