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.
This commit is contained in:
parent
09220eae9d
commit
cee59b3fea
6 changed files with 27 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue