This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: MemoryView missing from Python 2.4 and 2.6
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: "Wiederhake\, Tim" <tim dot wiederhake at intel dot com>
- Cc: "Jose E. Marchesi" <jose dot marchesi at oracle dot com>, "gdb-patches\@sourceware.org" <gdb-patches at sourceware dot org>
- Date: Fri, 03 Mar 2017 10:21:39 +0000
- Subject: Re: MemoryView missing from Python 2.4 and 2.6
- Authentication-results: sourceware.org; auth=none
- References: <87o9xsx38r.fsf@oracle.com> <20170223225946.snir4ab6twc7vo7n@localhost> <9676A094AF46E14E8265E7A3F4CCE9AF9417D1@irsmsx105.ger.corp.intel.com> <86h93j7evn.fsf@gmail.com> <9676A094AF46E14E8265E7A3F4CCE9AF941DE1@irsmsx105.ger.corp.intel.com>
"Wiederhake, Tim" <tim.wiederhake@intel.com> writes:
> 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.
The change looks reasonable to me. Do we need to update test case?
In py-inferior.exp, we have
gdb_py_test_silent_cmd "python str = gdb.inferiors()\[0\].read_memory (addr, 5); print(str)" \
"read str contents" 1
if { $gdb_py_is_py3k == 0 } {
gdb_py_test_silent_cmd "python a = 'a'" "" 0
} else {
gdb_py_test_silent_cmd "python a = bytes('a', 'ascii')" "" 0
}
I assume we need something similar here.
--
Yao (齐尧)