aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-09-15 11:08:56 -0600
committerTom Tromey <tromey@adacore.com>2020-09-15 11:08:56 -0600
commit37431074656958dfb788a1980f5a1cd474705b83 (patch)
tree806a53e6f14f7c5df7a10b24652e1ad1b4a14068 /gdb
parent08cc37dd042338209c8e2aa5db04aef2ecb5c62b (diff)
downloadgdb-37431074656958dfb788a1980f5a1cd474705b83.zip
gdb-37431074656958dfb788a1980f5a1cd474705b83.tar.gz
gdb-37431074656958dfb788a1980f5a1cd474705b83.tar.bz2
Don't use PyInt_FromSsize_t
Change the Python layer to avoid PyInt_FromSsize_t, and remove the compatibility define. gdb/ChangeLog 2020-09-15 Tom Tromey <tromey@adacore.com> * python/python-internal.h (PyInt_FromSsize_t): Remove define. * python/py-record.c (recpy_element_number): Use gdb_py_object_from_longest. (recpy_gap_number): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/python/py-record.c4
-rw-r--r--gdb/python/python-internal.h1
3 files changed, 9 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7481416..8a7ad2a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2020-09-15 Tom Tromey <tromey@adacore.com>
+ * python/python-internal.h (PyInt_FromSsize_t): Remove define.
+ * python/py-record.c (recpy_element_number): Use
+ gdb_py_object_from_longest.
+ (recpy_gap_number): Likewise.
+
+2020-09-15 Tom Tromey <tromey@adacore.com>
+
* top.c (ui::ui): Update.
(highest_ui_num): Remove.
* top.h (struct ui) <num>: Remove.
diff --git a/gdb/python/py-record.c b/gdb/python/py-record.c
index a081ca9..a6b08dc 100644
--- a/gdb/python/py-record.c
+++ b/gdb/python/py-record.c
@@ -374,7 +374,7 @@ recpy_element_number (PyObject *self, void* closure)
{
const recpy_element_object * const obj = (recpy_element_object *) self;
- return PyInt_FromSsize_t (obj->number);
+ return gdb_py_object_from_longest (obj->number).release ();
}
/* Implementation of RecordInstruction.__hash__ [int] and
@@ -454,7 +454,7 @@ recpy_gap_number (PyObject *self, void *closure)
{
const recpy_gap_object * const obj = (const recpy_gap_object *) self;
- return PyInt_FromSsize_t (obj->number);
+ return gdb_py_object_from_longest (obj->number).release ();
}
/* Implementation of RecordGap.error_code [int]. */
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 6874543..e406f37 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -97,7 +97,6 @@
#define PyInt_Check PyLong_Check
#define PyInt_FromLong PyLong_FromLong
-#define PyInt_FromSsize_t PyLong_FromSsize_t
#define PyInt_AsLong PyLong_AsLong
#define PyInt_AsSsize_t PyLong_AsSsize_t