diff options
author | Phil Muldoon <pmuldoon@redhat.com> | 2013-10-03 14:43:32 +0000 |
---|---|---|
committer | Phil Muldoon <pmuldoon@redhat.com> | 2013-10-03 14:43:32 +0000 |
commit | 06ab7b19e0f364881cd4b0ef67b2064dd83ee1c6 (patch) | |
tree | f06e3e68c392c86dbccba22ac2d5f0399136e958 /gdb/python/py-arch.c | |
parent | 8ae377e842506aa177ec8d8d222a6afcb7f65982 (diff) | |
download | gdb-06ab7b19e0f364881cd4b0ef67b2064dd83ee1c6.zip gdb-06ab7b19e0f364881cd4b0ef67b2064dd83ee1c6.tar.gz gdb-06ab7b19e0f364881cd4b0ef67b2064dd83ee1c6.tar.bz2 |
2013-10-03 Phil Muldoon <pmuldoon@redhat.com>
* python/py-value.c (convert_value_from_python): Move PyInt_Check
conversion logic to occur after PyLong_Check. Comment on order
change significance.
* python/py-arch.c (archpy_disassemble): Comment on order of
conversion for integers and longs.
Diffstat (limited to 'gdb/python/py-arch.c')
-rw-r--r-- | gdb/python/py-arch.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/python/py-arch.c b/gdb/python/py-arch.c index a31ffdd..a351c12 100644 --- a/gdb/python/py-arch.c +++ b/gdb/python/py-arch.c @@ -132,6 +132,13 @@ archpy_disassemble (PyObject *self, PyObject *args, PyObject *kw) start = start_temp; if (end_obj) { + /* Make a long logic check first. In Python 3.x, internally, + all integers are represented as longs. In Python 2.x, there + is still a differentiation internally between a PyInt and a + PyLong. Explicitly do this long check conversion first. In + GDB, for Python 3.x, we #ifdef PyInt = PyLong. This check has + to be done first to ensure we do not lose information in the + conversion process. */ if (PyLong_Check (end_obj)) end = PyLong_AsUnsignedLongLong (end_obj); else if (PyInt_Check (end_obj)) |