diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2022-03-21 10:07:41 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2022-03-23 07:42:57 -0400 |
commit | 5aee45879681a7a76754a25b3f4f96b4529f7ae3 (patch) | |
tree | 04698477d38cf45871c7542eea6ce6a8d2b46a18 /gdb/python/py-registers.c | |
parent | edae3fd6600f10f9e16dc017b705959f541ed19a (diff) | |
download | binutils-5aee45879681a7a76754a25b3f4f96b4529f7ae3.zip binutils-5aee45879681a7a76754a25b3f4f96b4529f7ae3.tar.gz binutils-5aee45879681a7a76754a25b3f4f96b4529f7ae3.tar.bz2 |
gdb/python: remove Python 2/3 compatibility macros
New in this version:
- Rebase on master, fix a few more issues that appeared.
python-internal.h contains a number of macros that helped make the code
work with both Python 2 and 3. Remove them and adjust the code to use
the Python 3 functions.
Change-Id: I99a3d80067fb2d65de4f69f6473ba6ffd16efb2d
Diffstat (limited to 'gdb/python/py-registers.c')
-rw-r--r-- | gdb/python/py-registers.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/python/py-registers.c b/gdb/python/py-registers.c index b3f784e..eab88a3 100644 --- a/gdb/python/py-registers.c +++ b/gdb/python/py-registers.c @@ -138,7 +138,7 @@ gdbpy_reggroup_to_string (PyObject *self) struct reggroup *reggroup = group->reggroup; const char *name = reggroup_name (reggroup); - return PyString_FromString (name); + return PyUnicode_FromString (name); } /* Implement gdb.RegisterGroup.name (self) -> String. @@ -196,7 +196,7 @@ gdbpy_register_descriptor_to_string (PyObject *self) int regnum = reg->regnum; const char *name = gdbarch_register_name (gdbarch, regnum); - return PyString_FromString (name); + return PyUnicode_FromString (name); } /* Implement gdb.RegisterDescriptor.name attribute get function. Return a @@ -391,7 +391,7 @@ gdbpy_parse_register_id (struct gdbarch *gdbarch, PyObject *pyo_reg_id, } } /* The register could be its internal GDB register number. */ - else if (PyInt_Check (pyo_reg_id)) + else if (PyLong_Check (pyo_reg_id)) { long value; if (gdb_py_int_as_long (pyo_reg_id, &value) && (int) value == value) |