From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Andrew Cagney Cc: Michael Snyder , gdb-patches@sources.redhat.com Subject: Re: [RFC/RFA] gdb extension for Harvard architectures Date: Fri, 28 Sep 2001 17:44:00 -0000 Message-id: <3BB5195F.6050603@cygnus.com> References: <3BB4D843.A92818B9@cygnus.com> <3BB512A9.6050801@cygnus.com> X-SW-Source: 2001-09/msg00447.html > What about expressions. > > Consider > (gdb) print (char *) function > > should that return: > > (@data char *) ... > or (@code char *) ... Oops, pressed the wrong button ... My question here is, should the address space be propogated through a type conversion (when it isn't explicitly specified)? The user might have the expression: x/i function and then enter x/w function Both will examine the same memory location. The user could then try to manipulate that data with: print *(int*)function however, depending on the interpretation of the expression (I don't believe ISO C defines the semantics of this) you could end up printing a value from a completly different address space. Would it be better if the cast operator, by default, preserved the address space of the pointer being cast? Andrew