This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfc/rfa:doc] INTEGER_TO_ADDRESS; Was: INTEGER_TO_ADDRESS(), thoughts?
- To: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Subject: Re: [rfc/rfa:doc] INTEGER_TO_ADDRESS; Was: INTEGER_TO_ADDRESS(), thoughts?
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 03 Oct 2001 16:29:15 -0400
- Cc: gdb-patches at sources dot redhat dot com
- References: <3BA7F150.9060302@cygnus.com> <np1ykw8bny.fsf@zwingli.cygnus.com> <3BB0F62D.1080702@cygnus.com> <3BB8CA42.8030209@cygnus.com> <7458-Tue02Oct2001091222+0300-eliz@is.elta.co.il>
> Since most of this sentence is in plural, I think it should start with
> "When the users copy".
Hmm, I changed it all to single. Along with the other tweeks I ended up
with:
+
+ @item INTEGER_TO_ADDRESS (@var{type}, @var{buf})
+ @findex INTEGER_TO_ADDRESS
+ @cindex converting integers to addresses
+ Define this when the architecture needs to handle non-pointer to address
+ conversions specially. Converts that value to an address according to
+ the current architectures conventions.
+
+ @emph{Pragmatics: When the user copies a well defined expression from
+ their source code and pass it, as a parameter, to @value{GDBN}'s
+ @code{print} command, they should get the same value as would have been
+ computed by the target program. Any deviation from this rule can cause
+ major confusion and annoyance, and needs to be justified carefully. In
+ other words, @value{GDBN} doesn't really have the freedom to do these
+ conversions in clever and useful ways. It has, however, been pointed
+ out that users aren't complaining about how @value{GDBN} casts integers
+ to pointers; they are complaining that they can't take an address from a
+ disassembly listing and give it to @code{x/i}. Adding an architecture
+ method like @code{INTEGER_TO_ADDRESS} certainly makes it possible for
+ @value{GDBN} to ``get it right'' in all circumstances.}
+
+ @xref{Target Architecture Definition, , Pointers Are Not Always
+ Addresses}.
hope its right,
Andrew