Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: gdb@sources.redhat.com
Subject: a value has-a location
Date: Tue, 02 Nov 2004 15:14:00 -0000	[thread overview]
Message-ID: <4187A414.5060804@gnu.org> (raw)

(back to this one again)

We've the relationship:

        LOCATION ----<> VALUE <>----- TYPE
            .
           /_\
            |
            +-------------------------.
            |                         |
      DWARF-2 LOCATION         LEGACY LOCATION

That is:

A VALUE has-a TYPE and a LOCATION.  The LOCATION describing how to 
obtain the BITS and BYTES belonging to the value (but may not actually 
contan those bits and bytes).

LOCATION could have methods such as:

	int read (offset, length, readbuf)
	    -- read at least some of the bytes
	void read_full (offset, length, writebuf)
	    -- read all the bytes, or throw an error
	int io (offset, length, readbuf, writebuf)

and perhaphs:

	iterate-over-pieces (method)
	    -- call method with each register/memory piece
	    -- needed by watchpoints

A DWARF-2 LOCATION would be implemented using the DWARF-2 code.  A 
LEGACY LOCATION would accomodate the old more explicit way of doing things.

It is this that will replace VALUE_CONTENTS{,_RAW} et.al.

I intend refactoring ``struct value'' so that there is an explicit 
location object (at present it's a union :-/).  Initially it will 
probably remain in ``struct value''.  Once the location has been 
separated out we can look at making it virtual with separate dwarf-2 and 
legacy locations.

comments?
Andrew


             reply	other threads:[~2004-11-02 15:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-02 15:14 Andrew Cagney [this message]
2004-11-02 15:32 ` Joel Brobecker
2005-02-07 20:17 ` Andrew Cagney

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=4187A414.5060804@gnu.org \
    --to=cagney@gnu.org \
    --cc=gdb@sources.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