diff options
author | Tim Wiederhake <tim.wiederhake@intel.com> | 2017-03-21 08:19:59 +0100 |
---|---|---|
committer | Tim Wiederhake <tim.wiederhake@intel.com> | 2017-03-21 08:19:59 +0100 |
commit | cee59b3feac9a8f6300a5b788e3db4e15af2a894 (patch) | |
tree | 3ae196bdbd61797105f0c3b50c34dc8ecbc8b027 /gdb/python | |
parent | 09220eae9df07c40d206a35e6caaecba92ab8f46 (diff) | |
download | gdb-cee59b3feac9a8f6300a5b788e3db4e15af2a894.zip gdb-cee59b3feac9a8f6300a5b788e3db4e15af2a894.tar.gz gdb-cee59b3feac9a8f6300a5b788e3db4e15af2a894.tar.bz2 |
Fix break on Python 2
This changes the return type of "gdb.BtraceInstruction.data ()" from
"memoryview" to "buffer" on Python 2.7 and below, similar to what
"gdb.Inferior.read_memory ()" does.
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/py-record-btrace.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/python/py-record-btrace.c b/gdb/python/py-record-btrace.c index 6158f31..c816332 100644 --- a/gdb/python/py-record-btrace.c +++ b/gdb/python/py-record-btrace.c @@ -330,7 +330,12 @@ btpy_insn_data (PyObject *self, void *closure) if (object == NULL) return NULL; +#ifdef IS_PY3K return PyMemoryView_FromObject (object); +#else + return PyBuffer_FromObject (object, 0, Py_END_OF_BUFFER); +#endif + } /* Implementation of BtraceInstruction.decode [str]. Returns |