public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@redhat.com>
To: Stan Cox <scox@redhat.com>
Cc: Frysk List <frysk@sourceware.org>
Subject: Re: dereferencing pointers from frysk.value
Date: Fri, 27 Jul 2007 15:53:00 -0000	[thread overview]
Message-ID: <46AA1512.3040908@redhat.com> (raw)
In-Reply-To: <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?
>
>
>   

  reply	other threads:[~2007-07-27 15:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-27 15:02 Stan Cox
2007-07-27 15:53 ` Andrew Cagney [this message]
2007-07-30 20:41   ` Stan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46AA1512.3040908@redhat.com \
    --to=cagney@redhat.com \
    --cc=frysk@sourceware.org \
    --cc=scox@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).