mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 02:24:17 +08:00
* gdb.texinfo (Artificial arrays): Note use of coerce-to-array-type.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
Fri Feb 17 15:24:35 1995 Per Bothner <bothner@kalessin.cygnus.com>
|
||||||
|
|
||||||
|
* gdb.texinfo (Artificial arrays): Note use of coerce-to-array-type.
|
||||||
|
|
||||||
Wed Feb 15 11:59:18 1995 J.T. Conklin <jtc@rtl.cygnus.com>
|
Wed Feb 15 11:59:18 1995 J.T. Conklin <jtc@rtl.cygnus.com>
|
||||||
|
|
||||||
* all-cfg.texi: New flag, GDBSERVE, for NetWare's gdbserve.nlm.
|
* all-cfg.texi: New flag, GDBSERVE, for NetWare's gdbserve.nlm.
|
||||||
|
@ -4078,6 +4078,22 @@ subscripting, and are coerced to pointers when used in expressions.
|
|||||||
Artificial arrays most often appear in expressions via the value history
|
Artificial arrays most often appear in expressions via the value history
|
||||||
(@pxref{Value History, ,Value history}), after printing one out.
|
(@pxref{Value History, ,Value history}), after printing one out.
|
||||||
|
|
||||||
|
Another way to create an artificial array is to use a cast.
|
||||||
|
This re-interprets a value as if it were an array.
|
||||||
|
The value need not be in memory:
|
||||||
|
@example
|
||||||
|
(@value{GDBP}) p/x (short[2])0x12345678
|
||||||
|
$1 = @{0x1234, 0x5678@}
|
||||||
|
@end example
|
||||||
|
|
||||||
|
As a convenience, if you leave the array length out (as in
|
||||||
|
@samp{(@var{type})[])@var{value}}) gdb calculates the size to fill
|
||||||
|
the value (as @samp{sizeof(@var{value})/sizeof(@var{type})}:
|
||||||
|
@example
|
||||||
|
(@value{GDBP}) p/x (short[])0x12345678
|
||||||
|
$2 = @{0x1234, 0x5678@}
|
||||||
|
@end example
|
||||||
|
|
||||||
Sometimes the artificial array mechanism is not quite enough; in
|
Sometimes the artificial array mechanism is not quite enough; in
|
||||||
moderately complex data structures, the elements of interest may not
|
moderately complex data structures, the elements of interest may not
|
||||||
actually be adjacent---for example, if you are interested in the values
|
actually be adjacent---for example, if you are interested in the values
|
||||||
|
Reference in New Issue
Block a user