From: Michael Snyder <msnyder@cygnus.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC/RFA] gdb extension for Harvard architectures
Date: Wed, 03 Oct 2001 10:41:00 -0000 [thread overview]
Message-ID: <3BBB4D90.AE2B5AEE@cygnus.com> (raw)
In-Reply-To: <3BB4E273.5020308@cygnus.com>
Andrew Cagney wrote:
>
> > + extern char *
> > + address_space_int_to_name (int space_flag)
> > + {
> > + if (space_flag & TYPE_FLAG_CODE_SPACE)
> > + return "code";
> > + else if (space_flag & TYPE_FLAG_DATA_SPACE)
> > + return "data";
> > + else
> > + return NULL;
> > + }
> > +
>
> Some thoughts on the internals.
>
> Should these spaces be flags or an enumeration? I don't think being
> able to specify space = (CODE | DATA) is meanginful. Haveing bit masks
> also puts a limitation on the number of spaces.
Yes, but it's a generous limitation (there are 20 more bits available).
I'll go either way -- the trade-off is that if we don't use the "flags"
field, we have to add a new field to the (struct type) data structure.
> Should a flag always be set (if not specified explicitly). For
> instance, a ``(*)()'' which implies the code space explicitly setting it
> as such? That will make some of the pointer to/from address code easier
> - just check the space - no need to test for func or method or ....
Maybe, but that can be done as a follow-on extension to what I've done.
The change I've submitted works now, it doesn't require this addition
(so we don't have to decide now).
I should explain -- without this change, the way GDB currently does this
is to look at the types of expressions, and divide them into two categories:
1) functions and things pointed to by function pointers, and
2) everything else (which basically includes data-like objects
(scalars, structs, arrays of data-like objects...)
The first are always treated as living in code-space, and
the second are always treated as living in data-space.
The extension that I'm submitting merely gives the user
the ability to override that assumption (eg. to look at
data objects that have been located in code space).
If an expression is _not_ cast using the "@code" or "@data"
modifiers, then the original defaults still apply.
> I suspect that this is going to slowly affect other parts. At present
> there is a singe TARGET_PTR_BIT. Given different address spaces can
> have different sizes, that macro will be replaced by a more generic
> (target_space_ptr_bit (space).
>
> As you note, for the moment text/data are hardwired / pre-defined
> Eventually the target architecture will want an oportunity to define
> other spaces. That can follow.
Yep. Many more changes are likely to follow, step by step.
next prev parent reply other threads:[~2001-10-03 10:41 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-28 13:07 Michael Snyder
2001-09-28 13:50 ` Andrew Cagney
2001-10-03 10:41 ` Michael Snyder [this message]
2001-10-03 11:06 ` Daniel Jacobowitz
2001-10-03 11:12 ` Michael Snyder
2001-10-03 11:19 ` Andrew Cagney
2001-10-03 11:49 ` Michael Snyder
2001-10-03 14:38 ` Andrew Cagney
2001-10-03 14:14 ` Jim Blandy
2001-10-03 14:31 ` Andrew Cagney
2001-10-03 16:14 ` Jim Blandy
2001-10-04 11:44 ` Michael Snyder
2001-10-04 16:28 ` Jim Blandy
2001-09-28 17:15 ` Andrew Cagney
2001-09-28 17:44 ` Andrew Cagney
2001-10-02 12:59 ` Jim Blandy
2001-10-02 14:13 ` Andrew Cagney
2001-10-02 15:09 ` Michael Snyder
2001-10-02 16:58 ` Andrew Cagney
2001-10-03 10:10 ` Jim Blandy
2001-10-03 12:22 ` Andrew Cagney
2001-10-03 15:08 ` Jim Blandy
2001-10-10 0:56 ` Andrew Cagney
2001-10-09 23:34 ` Andrew Cagney
2001-10-10 10:53 ` Jim Blandy
2001-10-10 11:17 ` Andrew Cagney
2001-10-10 12:15 ` Jim Blandy
2001-10-10 12:31 ` Andrew Cagney
2001-10-10 0:16 ` Andrew Cagney
2001-10-03 11:11 ` Michael Snyder
2001-10-04 12:08 ` Michael Snyder
2001-10-04 13:13 ` Andrew Cagney
2001-10-08 10:36 ` Michael Snyder
2001-10-10 1:25 ` Andrew Cagney
2001-11-05 11:34 ` Michael Snyder
2001-10-02 16:14 ` Jim Blandy
2001-10-02 17:16 ` Andrew Cagney
2001-10-02 17:31 ` Michael Snyder
2001-10-02 19:09 ` Andrew Cagney
2001-10-03 12:41 ` Jim Blandy
2001-10-03 12:52 ` Andrew Cagney
2001-10-03 16:13 ` Jim Blandy
2001-10-03 16:51 ` Frank Ch. Eigler
2001-10-03 10:55 ` Michael Snyder
2001-10-03 11:06 ` Andrew Cagney
2001-10-03 11:51 ` Michael Snyder
2001-10-03 12:17 ` Andrew Cagney
2001-10-03 16:54 ` Michael Snyder
2001-10-03 14:33 ` Jim Blandy
2001-10-03 14:44 ` Andrew Cagney
2001-10-03 16:17 ` Jim Blandy
2001-10-04 13:16 ` Andrew Cagney
2001-10-10 0:45 ` Andrew Cagney
2001-10-10 10:56 ` Jim Blandy
2001-10-03 14:48 ` Andrew Cagney
2001-10-04 11:49 ` Michael Snyder
2001-10-03 10:49 ` Michael Snyder
2001-09-29 2:29 ` Eli Zaretskii
2001-10-02 19:27 ` Andrew Cagney
2001-10-03 14:04 ` Jim Blandy
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=3BBB4D90.AE2B5AEE@cygnus.com \
--to=msnyder@cygnus.com \
--cc=ac131313@cygnus.com \
--cc=gdb-patches@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