This is the mail archive of the
frysk@sourceware.org
mailing list for the frysk project.
Re: dereferencing pointers from frysk.value
- From: Andrew Cagney <cagney at redhat dot com>
- To: Stan Cox <scox at redhat dot com>
- Cc: Frysk List <frysk at sourceware dot org>
- Date: Fri, 27 Jul 2007 11:53:54 -0400
- Subject: Re: dereferencing pointers from frysk.value
- References: <1185548524.11775.27.camel@multics.rdu.redhat.com>
So at present a "pointer" value is seen as a pair:
type: pointer->char
location: byte-buffer with size==sizeof(void*) and
contents=="pointer value"
and there's nothing for the "pointer" to point into?
It sounds like the Type.toPrint() method should be parameterised with
not just the ByteBuffer containing the value, but also the address space
or segment[s] to which that value could refer. As an aside, the
toPrint method should probably also be parameterized with a base-type
formatter so that <<print astruct -format x>> gives <<{ 0x123, 0x456 }>>
with these, PrintValue is reduced to:
BaseTypeWriter baseTypeWriter = select writer based on -format
Value result = cli.parseValue(expression);
result.toPrint(outputWriter, task.getMemory(), baseTypeWriter)
Andrew
For the case of memory,
Stan Cox wrote:
Currently a class is essentially a list of types and a ByteBuffer of the
class contents. It might be nice to dereference a pointer if the
pointer's type is char* and display the string. However ClassType just
has a pointer, no task to do a task.getMemory() on. DebugInfo has that
information. Any suggestions on a nice way to handle this?