|
|
|
@ -2487,22 +2487,19 @@ C@t{++} reference type. |
|
|
|
@end deftypefn |
|
|
|
|
|
|
|
|
|
|
|
@section Using Different Register and Memory Data Representations |
|
|
|
@cindex raw representation |
|
|
|
@cindex virtual representation |
|
|
|
@cindex representations, raw and virtual |
|
|
|
@cindex register data formats, converting |
|
|
|
@cindex @code{struct value}, converting register contents to |
|
|
|
|
|
|
|
@emph{Maintainer's note: The way GDB manipulates registers is undergoing |
|
|
|
significant change. Many of the macros and functions refered to in the |
|
|
|
section below are likely to be made obsolete. For instance, instead of |
|
|
|
having different raw and virtual register sizes, an architecture can |
|
|
|
define pseudo-registers that map onto the raw registers. |
|
|
|
|
|
|
|
See the @uref{http://www.gnu.org/software/gdb/bugs/, Bug Tracking |
|
|
|
Database} and @uref{http://sources.redhat.com/gdb/current/ari, ARI |
|
|
|
Index} for more up-to-date information.} |
|
|
|
@section Raw and Virtual Register Representations |
|
|
|
@cindex raw register representation |
|
|
|
@cindex virtual register representation |
|
|
|
@cindex representations, raw and virtual registers |
|
|
|
|
|
|
|
@emph{Maintainer note: This section is pretty much obsolete. The |
|
|
|
functionality described here has largely been replaced by |
|
|
|
pseudo-registers and the mechanisms described in @ref{Target |
|
|
|
Architecture Definition, , Using Different Register and Memory Data |
|
|
|
Representations}. See also @uref{http://www.gnu.org/software/gdb/bugs/, |
|
|
|
Bug Tracking Database} and |
|
|
|
@uref{http://sources.redhat.com/gdb/current/ari/, ARI Index} for more |
|
|
|
up-to-date information.} |
|
|
|
|
|
|
|
Some architectures use one representation for a value when it lives in a |
|
|
|
register, but use a different representation when it lives in memory. |
|
|
|
@ -2510,6 +2507,10 @@ In @value{GDBN}'s terminology, the @dfn{raw} representation is the one used in |
|
|
|
the target registers, and the @dfn{virtual} representation is the one |
|
|
|
used in memory, and within @value{GDBN} @code{struct value} objects. |
|
|
|
|
|
|
|
@emph{Maintainer note: Notice that the same mechanism is being used to |
|
|
|
both convert a register to a @code{struct value} and alternative |
|
|
|
register forms.} |
|
|
|
|
|
|
|
For almost all data types on almost all architectures, the virtual and |
|
|
|
raw representations are identical, and no special handling is needed. |
|
|
|
However, they do occasionally differ. For example: |
|
|
|
@ -2594,6 +2595,85 @@ their @var{reg} and @var{type} arguments in different orders. |
|
|
|
@end deftypefn |
|
|
|
|
|
|
|
|
|
|
|
@section Using Different Register and Memory Data Representations |
|
|
|
@cindex register representation |
|
|
|
@cindex memory representation |
|
|
|
@cindex representations, register and memory |
|
|
|
@cindex register data formats, converting |
|
|
|
@cindex @code{struct value}, converting register contents to |
|
|
|
|
|
|
|
@emph{Maintainer's note: The way GDB manipulates registers is undergoing |
|
|
|
significant change. Many of the macros and functions refered to in this |
|
|
|
section are likely to be subject to further revision. See |
|
|
|
@uref{http://sources.redhat.com/gdb/current/ari/, A.R. Index} and |
|
|
|
@uref{http://www.gnu.org/software/gdb/bugs, Bug Tracking Database} for |
|
|
|
further information. cagney/2002-05-06.} |
|
|
|
|
|
|
|
Some architectures can represent a data object in a register using a |
|
|
|
form that is different to the objects more normal memory representation. |
|
|
|
For example: |
|
|
|
|
|
|
|
@itemize @bullet |
|
|
|
|
|
|
|
@item |
|
|
|
The Alpha architecture can represent 32 bit integer values in |
|
|
|
floating-point registers. |
|
|
|
|
|
|
|
@item |
|
|
|
The x86 architecture supports 80-bit floating-point registers. The |
|
|
|
@code{long double} data type occupies 96 bits in memory but only 80 bits |
|
|
|
when stored in a register. |
|
|
|
|
|
|
|
@end itemize |
|
|
|
|
|
|
|
In general, the register representation of a data type is determined by |
|
|
|
the architecture, or @value{GDBN}'s interface to the architecture, while |
|
|
|
the memory representation is determined by the Application Binary |
|
|
|
Interface. |
|
|
|
|
|
|
|
For almost all data types on almost all architectures, the two |
|
|
|
representations are identical, and no special handling is needed. |
|
|
|
However, they do occasionally differ. Your architecture may define the |
|
|
|
following macros to request conversions between the register and memory |
|
|
|
representations of a data type: |
|
|
|
|
|
|
|
@deftypefn {Target Macro} int CONVERT_REGISTER_P (int @var{reg}) |
|
|
|
Return non-zero if the representation of a data value stored in this |
|
|
|
register may be different to the representation of that same data value |
|
|
|
when stored in memory. |
|
|
|
|
|
|
|
When non-zero, the macros @code{REGISTER_TO_VALUE} and |
|
|
|
@code{VALUE_TO_REGISTER} are used to perform any necessary conversion. |
|
|
|
@end deftypefn |
|
|
|
|
|
|
|
@deftypefn {Target Macro} void REGISTER_TO_VALUE (int @var{reg}, struct type *@var{type}, char *@var{from}, char *@var{to}) |
|
|
|
Convert the value of register number @var{reg} to a data object of type |
|
|
|
@var{type}. The buffer at @var{from} holds the register's value in raw |
|
|
|
format; the converted value should be placed in the buffer at @var{to}. |
|
|
|
|
|
|
|
Note that @code{REGISTER_TO_VALUE} and @code{VALUE_TO_REGISTER} take |
|
|
|
their @var{reg} and @var{type} arguments in different orders. |
|
|
|
|
|
|
|
You should only use @code{REGISTER_TO_VALUE} with registers for which |
|
|
|
the @code{CONVERT_REGISTER_P} macro returns a non-zero value. |
|
|
|
@end deftypefn |
|
|
|
|
|
|
|
@deftypefn {Target Macro} void VALUE_TO_REGISTER (struct type *@var{type}, int @var{reg}, char *@var{from}, char *@var{to}) |
|
|
|
Convert a data value of type @var{type} to register number @var{reg}' |
|
|
|
raw format. |
|
|
|
|
|
|
|
Note that @code{REGISTER_TO_VALUE} and @code{VALUE_TO_REGISTER} take |
|
|
|
their @var{reg} and @var{type} arguments in different orders. |
|
|
|
|
|
|
|
You should only use @code{VALUE_TO_REGISTER} with registers for which |
|
|
|
the @code{CONVERT_REGISTER_P} macro returns a non-zero value. |
|
|
|
@end deftypefn |
|
|
|
|
|
|
|
@deftypefn {Target Macro} void REGISTER_CONVERT_TO_TYPE (int @var{regnum}, struct type *@var{type}, char *@var{buf}) |
|
|
|
See @file{mips-tdep.c}. It does not do what you want. |
|
|
|
@end deftypefn |
|
|
|
|
|
|
|
|
|
|
|
@section Frame Interpretation |
|
|
|
|
|
|
|
@section Inferior Call Setup |
|
|
|
@ -2839,6 +2919,12 @@ otherwise, we should leave it alone. The function |
|
|
|
@code{default_coerce_float_to_double} provides this behavior; it is the |
|
|
|
default value, for compatibility with older configurations. |
|
|
|
|
|
|
|
@item int CONVERT_REGISTER_P(@var{regnum}) |
|
|
|
@findex CONVERT_REGISTER_P |
|
|
|
Return non-zero if register @var{regnum} can represent data values in a |
|
|
|
non-standard form. |
|
|
|
@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. |
|
|
|
|
|
|
|
@item CPLUS_MARKER |
|
|
|
@findex CPLUS_MARKERz |
|
|
|
Define this to expand into the character that G@t{++} uses to distinguish |
|
|
|
@ -3176,36 +3262,43 @@ address the pointer refers to. |
|
|
|
@item REGISTER_CONVERTIBLE (@var{reg}) |
|
|
|
@findex REGISTER_CONVERTIBLE |
|
|
|
Return non-zero if @var{reg} uses different raw and virtual formats. |
|
|
|
@xref{Target Architecture Definition, , Raw and Virtual Register Representations}. |
|
|
|
|
|
|
|
@item REGISTER_TO_VALUE(@var{regnum}, @var{type}, @var{from}, @var{to}) |
|
|
|
@findex REGISTER_TO_VALUE |
|
|
|
Convert the raw contents of register @var{regnum} into a value of type |
|
|
|
@var{type}. |
|
|
|
@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. |
|
|
|
|
|
|
|
@item REGISTER_RAW_SIZE (@var{reg}) |
|
|
|
@findex REGISTER_RAW_SIZE |
|
|
|
Return the raw size of @var{reg}; defaults to the size of the register's |
|
|
|
virtual type. |
|
|
|
@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. |
|
|
|
@xref{Target Architecture Definition, , Raw and Virtual Register Representations}. |
|
|
|
|
|
|
|
@item REGISTER_VIRTUAL_SIZE (@var{reg}) |
|
|
|
@findex REGISTER_VIRTUAL_SIZE |
|
|
|
Return the virtual size of @var{reg}; defaults to the size of the |
|
|
|
register's virtual type. |
|
|
|
@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. |
|
|
|
Return the virtual size of @var{reg}. |
|
|
|
@xref{Target Architecture Definition, , Raw and Virtual Register Representations}. |
|
|
|
|
|
|
|
@item REGISTER_VIRTUAL_TYPE (@var{reg}) |
|
|
|
@findex REGISTER_VIRTUAL_TYPE |
|
|
|
Return the virtual type of @var{reg}. |
|
|
|
@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. |
|
|
|
@xref{Target Architecture Definition, , Raw and Virtual Register Representations}. |
|
|
|
|
|
|
|
@item REGISTER_CONVERT_TO_VIRTUAL(@var{reg}, @var{type}, @var{from}, @var{to}) |
|
|
|
@findex REGISTER_CONVERT_TO_VIRTUAL |
|
|
|
Convert the value of register @var{reg} from its raw form to its virtual |
|
|
|
form. |
|
|
|
@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. |
|
|
|
@xref{Target Architecture Definition, , Raw and Virtual Register Representations}. |
|
|
|
|
|
|
|
@item REGISTER_CONVERT_TO_RAW(@var{type}, @var{reg}, @var{from}, @var{to}) |
|
|
|
@findex REGISTER_CONVERT_TO_RAW |
|
|
|
Convert the value of register @var{reg} from its virtual form to its raw |
|
|
|
form. |
|
|
|
@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. |
|
|
|
@xref{Target Architecture Definition, , Raw and Virtual Register Representations}. |
|
|
|
|
|
|
|
@item RETURN_VALUE_ON_STACK(@var{type}) |
|
|
|
@findex RETURN_VALUE_ON_STACK |
|
|
|
@ -3587,6 +3680,12 @@ being considered is known to have been compiled by GCC; this is helpful |
|
|
|
for systems where GCC is known to use different calling convention than |
|
|
|
other compilers. |
|
|
|
|
|
|
|
@item VALUE_TO_REGISTER(@var{type}, @var{regnum}, @var{from}, @var{to}) |
|
|
|
@findex VALUE_TO_REGISTER |
|
|
|
Convert a value of type @var{type} into the raw contents of register |
|
|
|
@var{regnum}'s. |
|
|
|
@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. |
|
|
|
|
|
|
|
@item VARIABLES_INSIDE_BLOCK (@var{desc}, @var{gcc_p}) |
|
|
|
@findex VARIABLES_INSIDE_BLOCK |
|
|
|
For dbx-style debugging information, if the compiler puts variable |
|
|
|
|