From fc0c74b114ec869ce89d12a282a1cbcb6ab7e6e8 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Mon, 15 Oct 2001 18:18:30 +0000 Subject: Add INTEGER_TO_ADDRESS to hadle nasty harvard architectures that do funnies to integer to address conversions. --- gdb/doc/ChangeLog | 7 +++++++ gdb/doc/gdbint.texinfo | 25 ++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'gdb/doc') diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 66300bb..9466bd2 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,10 @@ +2001-10-15 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Default + POINTER_TO_ADDRESS functions assume unsigned addresses. + (INTEGER_TO_ADDRESS): Document. Derive pragmatics section from a + posting by Jim Blandy. + 2001-10-12 Jim Blandy * Makefile.in (MAKEHTMLFLAGS): Remove -glossary; the most recent diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 46778f8..3c867fe 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -2489,7 +2489,7 @@ appropriate way for the current architecture. If you can, use Here are some macros which architectures can define to indicate the relationship between pointers and addresses. These have default definitions, appropriate for architectures on which all pointers are -simple byte addresses. +simple unsigned byte addresses. @deftypefn {Target Macro} CORE_ADDR POINTER_TO_ADDRESS (struct type *@var{type}, char *@var{buf}) Assume that @var{buf} holds a pointer of type @var{type}, in the @@ -3141,6 +3141,29 @@ function. A zero value indicates that it is not important or necessary to set a breakpoint to get through the dynamic linker and that single stepping will suffice. +@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 passes 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}. + @item IS_TRAPPED_INTERNALVAR (@var{name}) @findex IS_TRAPPED_INTERNALVAR This is an ugly hook to allow the specification of special actions that -- cgit v1.1