Re: [Qemu-devel] [PATCH v2] dump-guest-memory.py: fix python 2 support

2018-01-19 Thread Eric Blake
On 01/19/2018 10:25 AM, Marc-André Lureau wrote: > Python GDB support may use Python 2 or 3. > > Inferior.read_memory() may return a 'buffer' with Python 2 or a > 'memoryview' with Python 3 (see also > https://sourceware.org/gdb/onlinedocs/gdb/Inferiors-In-Python.html) > > The elf.add_vmcoreinfo_

Re: [Qemu-devel] [PATCH v2] dump-guest-memory.py: fix python 2 support

2018-01-19 Thread Laszlo Ersek
On 01/19/18 20:48, Eric Blake wrote: > On 01/19/2018 01:18 PM, Laszlo Ersek wrote: >> On 01/19/18 17:25, Marc-André Lureau wrote: >>> Python GDB support may use Python 2 or 3. >>> >>> Inferior.read_memory() may return a 'buffer' with Python 2 or a >>> 'memoryview' with Python 3 (see also >>> https:

Re: [Qemu-devel] [PATCH v2] dump-guest-memory.py: fix python 2 support

2018-01-19 Thread Eric Blake
On 01/19/2018 01:18 PM, Laszlo Ersek wrote: > On 01/19/18 17:25, Marc-André Lureau wrote: >> Python GDB support may use Python 2 or 3. >> >> Inferior.read_memory() may return a 'buffer' with Python 2 or a >> 'memoryview' with Python 3 (see also >> https://sourceware.org/gdb/onlinedocs/gdb/Inferiors

Re: [Qemu-devel] [PATCH v2] dump-guest-memory.py: fix python 2 support

2018-01-19 Thread Laszlo Ersek
On 01/19/18 17:25, Marc-André Lureau wrote: > Python GDB support may use Python 2 or 3. > > Inferior.read_memory() may return a 'buffer' with Python 2 or a > 'memoryview' with Python 3 (see also > https://sourceware.org/gdb/onlinedocs/gdb/Inferiors-In-Python.html) > > The elf.add_vmcoreinfo_note(

[Qemu-devel] [PATCH v2] dump-guest-memory.py: fix python 2 support

2018-01-19 Thread Marc-André Lureau
Python GDB support may use Python 2 or 3. Inferior.read_memory() may return a 'buffer' with Python 2 or a 'memoryview' with Python 3 (see also https://sourceware.org/gdb/onlinedocs/gdb/Inferiors-In-Python.html) The elf.add_vmcoreinfo_note() method expects a "bytes" object. Wrap the returned memor