+2020-09-15 Tom Tromey <tromey@adacore.com>
+
+ * python/python-internal.h (gdb_py_long_from_longest): Remove
+ defines.
+ * python/py-value.c (valpy_long): Use gdb_py_object_from_longest.
+ * python/py-type.c (convert_field, typy_get_sizeof): Use
+ gdb_py_object_from_longest.
+ * python/py-record-btrace.c (btpy_list_index): Use
+ gdb_py_object_from_longest.
+
2020-09-15 Tom Tromey <tromey@adacore.com>
* python/python-internal.h (PyInt_FromSsize_t): Remove define.
if (index < 0)
return PyErr_Format (PyExc_ValueError, _("Not in list."));
- return gdb_py_long_from_longest (index);
+ return gdb_py_object_from_longest (index).release ();
}
/* Implementation of BtraceList.count (self, value) -> int. */
if (type->code () == TYPE_CODE_ENUM)
{
- arg.reset (gdb_py_long_from_longest (TYPE_FIELD_ENUMVAL (type,
- field)));
+ arg = gdb_py_object_from_longest (TYPE_FIELD_ENUMVAL (type, field));
attrstring = "enumval";
}
else
if (TYPE_FIELD_LOC_KIND (type, field) == FIELD_LOC_KIND_DWARF_BLOCK)
arg = gdbpy_ref<>::new_reference (Py_None);
else
- arg.reset (gdb_py_long_from_longest (TYPE_FIELD_BITPOS (type,
- field)));
+ arg = gdb_py_object_from_longest (TYPE_FIELD_BITPOS (type, field));
attrstring = "bitpos";
}
if (size_varies)
Py_RETURN_NONE;
- return gdb_py_long_from_longest (TYPE_LENGTH (type));
+ return gdb_py_object_from_longest (TYPE_LENGTH (type)).release ();
}
/* Return the alignment of the type represented by SELF, in bytes. */
if (type->is_unsigned ())
return gdb_py_long_from_ulongest (l);
else
- return gdb_py_long_from_longest (l);
+ return gdb_py_object_from_longest (l).release ();
}
/* Implements conversion to float. */
#define GDB_PY_LLU_ARG "K"
typedef PY_LONG_LONG gdb_py_longest;
typedef unsigned PY_LONG_LONG gdb_py_ulongest;
-#define gdb_py_long_from_longest PyLong_FromLongLong
#define gdb_py_long_from_ulongest PyLong_FromUnsignedLongLong
#define gdb_py_long_as_ulongest PyLong_AsUnsignedLongLong
#define GDB_PY_LLU_ARG "K"
typedef long gdb_py_longest;
typedef unsigned long gdb_py_ulongest;
-#define gdb_py_long_from_longest PyLong_FromLong
#define gdb_py_long_from_ulongest PyLong_FromUnsignedLong
#define gdb_py_long_as_ulongest PyLong_AsUnsignedLong