This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: Add gdb.read_memory, gdb.write_memory and gdb.Membuf.
- From: Tom Tromey <tromey at redhat dot com>
- To: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- Cc: archer ml <archer at sourceware dot org>
- Date: Mon, 05 Jan 2009 16:43:43 -0700
- Subject: Re: Add gdb.read_memory, gdb.write_memory and gdb.Membuf.
- References: <1230581254.8380.97.camel@localhost.localdomain>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Thiago" == Thiago Jung Bauermann <bauerman@br.ibm.com> writes:
Thiago> One thing which has been in the back of my mind for the Python support
Thiago> in GDB is a way to read and write from/to the inferior memory. This
Thiago> patch addresses that.
Thanks.
Thiago> It's very simple: gdb.read_memory takes an address and a
Thiago> length and reads the bytes from the inferior, placing them in
Thiago> a Python buffer object. gdb.write_memory takes an address and
Thiago> a Python object supporting the buffer protocol[0] (i.e., the
Thiago> object from read_memory, an array or a string) and writes it
Thiago> to the inferior memory.
I was wondering whether we should have a buffer object be the access
method. That is, provide a new class, implementing the buffer
protocol, which provides "direct" access to inferior memory; it
could have a constructor accepting an address and a size. Then,
explicit read/write calls would not be needed.q
Is this feasible? Would it perform well enough?
Tom