This is the mail archive of the
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: <firstname.lastname@example.org>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Thiago" == Thiago Jung Bauermann <email@example.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.
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 (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?