From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Blandy To: Andrew Cagney Cc: Jim Blandy , Michael Snyder , gdb-patches@sources.redhat.com Subject: Re: [RFC/RFA] gdb extension for Harvard architectures Date: Wed, 03 Oct 2001 15:08:00 -0000 Message-id: References: <3BB4D843.A92818B9@cygnus.com> <3BB512A9.6050801@cygnus.com> <3BB5195F.6050603@cygnus.com> <3BBA2DC9.5060500@cygnus.com> <3BBA3B03.B864ABE0@cygnus.com> <3BBA54AE.3080104@cygnus.com> <3BBB6549.2050803@cygnus.com> X-SW-Source: 2001-10/msg00069.html Andrew Cagney writes: > > - If an expression E has some type T, then &E has type T *. > > To be pedantic: > > An expression E has some type T, then &E has type T *@data. > > It is defining a pointer from data space to either code or data > space. If something isn't an lvalue, the space qualifier is meaningless. > > This is a fundamental operation, and choosing the wrong behavior here > > will inevitably cause troubles elsewhere, too. > > > > Suppose you attach the qualifier to the pointer, and not the pointee. > > That is, `@code' may only be applied to pointer types, and it means > > that the pointer points to something in code space. > > Sorry, you've lost me. What is being discussed is the cast operator and > its semantics. A cast takes a type and expression parameter and returns > an expression. That was meant to answer the following question you asked: > The basic framework attached the segment information to the pointee > rather than pointer. Was this an arbitrary decision or based on some > theoretical framework. > To the best of my knowledge, ISO C says nothing about cast operations > that convert between code and data pointers. What we do have is a > certain level of accepted behavour. For instance on a unified byte > addressable address space architecture things like: > > sizeof(void*) == sizeof((*)()) > ((*)()) (void*) foo == ((*)()) foo > > However, on a harvard address space architecture we have none of that. Right. We don't. What's your point?