+2017-03-21 Tim Wiederhake <tim.wiederhake@intel.com>
+
+ * python/py-record-btrace.c (btpy_insn_data): Change return type
+ for Python 2.
+
2017-03-20 Simon Marchi <simon.marchi@polymtl.ca>
* spu-linux-nat.c (spu_fetch_inferior_registers,
+2017-03-21 Tim Wiederhake <tim.wiederhake@intel.com>
+
+ * python.texi (Recordings In Python): Document return type of
+ gdb.BtraceInstruction.data.
+
2017-03-20 Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
* gdb.texinfo (gdb/mi Symbol Query Commands): Document new MI
@defvar BtraceInstruction.data
A buffer with the raw instruction data. May be @code{None} if the
-instruction is a gap.
+instruction is a gap. In Python 3, the return value is a @code{memoryview}
+object.
@end defvar
@defvar BtraceInstruction.decoded
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
+2017-03-21 Tim Wiederhake <tim.wiederhake@intel.com>
+
+ * gdb.python/py-record-btrace.exp: Check for buffer on Python 2
+ and memory view on Python 3.
+
2017-03-20 Artemiy Volkov <artemiyv@acm.org>
Keith Seitz <keiths@redhat.com>
gdb_test "python print(i.error)" "None"
gdb_test "python print(i.sal)" "symbol and line for .*"
gdb_test "python print(i.pc)" "$decimal"
- gdb_test "python print(i.data)" "<memory at $hex>"
+ if { $gdb_py_is_py3k == 0 } {
+ gdb_test "python print(repr(i.data))" "<read-only buffer for $hex,.*>"
+ } else {
+ gdb_test "python print(repr(i.data))" "<memory at $hex>"
+ }
gdb_test "python print(i.decoded)" ".*"
gdb_test "python print(i.size)" "$decimal"
gdb_test "python print(i.is_speculative)" "False"