Don't use PyLong_FromUnsignedLong
authorTom Tromey <tromey@adacore.com>
Tue, 15 Sep 2020 17:08:56 +0000 (11:08 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 15 Sep 2020 17:08:57 +0000 (11:08 -0600)
This changes gdb to avoid PyLong_FromUnsignedLong, preferring
gdb_py_object_from_ulongest instead.

gdb/ChangeLog
2020-09-15  Tom Tromey  <tromey@adacore.com>

* python/python.c (gdbpy_parameter_value): Use
gdb_py_object_from_ulongest.

gdb/ChangeLog
gdb/python/python.c

index 468bbc6cdad8803bece8c472978416ed69dc6fc5..4059cf13450c53c9421af2078a77c87ead11d10c 100644 (file)
@@ -1,3 +1,8 @@
+2020-09-15  Tom Tromey  <tromey@adacore.com>
+
+       * python/python.c (gdbpy_parameter_value): Use
+       gdb_py_object_from_ulongest.
+
 2020-09-15  Tom Tromey  <tromey@adacore.com>
 
        * python/py-infevents.c (create_register_changed_event_object):
index 9cc8af6333831939a90e4547650f96b6a08a3aed..878602712d8e3d95a64d823981afae4ddcd45ae4 100644 (file)
@@ -504,13 +504,13 @@ gdbpy_parameter_value (enum var_types type, void *var)
 
        if (val == UINT_MAX)
          Py_RETURN_NONE;
-       return PyLong_FromUnsignedLong (val);
+       return gdb_py_object_from_ulongest (val).release ();
       }
 
     case var_zuinteger:
       {
        unsigned int val = * (unsigned int *) var;
-       return PyLong_FromUnsignedLong (val);
+       return gdb_py_object_from_ulongest (val).release ();
       }
     }