This is the mail archive of the frysk@sourceware.org mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dereferencing pointers from frysk.value


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?




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]