gdb.Value provides a way to get a textual string (gdb.Value.string(...)), but there's no way to get it as a raw sequence of bytes. Maybe this could be done with an encoding argument of None?
v = gdb.parse_and_eval("var")
data = v.string(None, length=64)
A method on Value would be fine, but there's also
It seems to me that there are two different things we might
want to expose.
One thing is access to the underlying bytes of a Value.
This is maybe a little tricky because a Value might not have
all the bytes available.
The other thing is using a pointer value to fetch memory.
This can be done via read_memory, though it might be
nice to also have a convenience method on Value.