diff options
author | Daniel Jacobowitz <drow@false.org> | 2008-03-21 15:02:38 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2008-03-21 15:02:38 +0000 |
commit | 6309237547d076d68daaf8f4d0cd55c5964e1411 (patch) | |
tree | ff4100d106e01c43dd82f47a59d0071d99cae1c6 /gdb/doc | |
parent | b21991b00cf16b94e9646a054e786c1fa4d5501a (diff) | |
download | gdb-6309237547d076d68daaf8f4d0cd55c5964e1411.zip gdb-6309237547d076d68daaf8f4d0cd55c5964e1411.tar.gz gdb-6309237547d076d68daaf8f4d0cd55c5964e1411.tar.bz2 |
* eval.c (evaluate_subexp_for_address): Clarify error message.
Use value_must_coerce_to_target.
* infcall.c (value_arg_coerce): Call value_coerce_to_target.
* valops.c (value_assign): Call value_coerce_to_target when
assigning to anything but internalvars. Leave GDB-side arrays
as arrays when assigning to internalvars.
(value_must_coerce_to_target, value_coerce_to_target): New.
(value_coerce_array, value_addr): Call value_coerce_to_target.
(value_array): Create the array in GDB's memory instead of
the inferior's.
* value.h (value_must_coerce_to_target, value_coerce_to_target):
Declare.
* gdb.texinfo (Expressions): Update description of malloced arrays.
* gdb.base/printcmds.exp (test_print_array_constants): Do not expect
*& to work on created array elements.
(Top level): Test print $pc with a file. Test string operations
without a target.
* gdb.base/ptype.exp: Do not expect *& to work on created array
elements.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index d32caf6..4b5ae97 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2008-03-21 Daniel Jacobowitz <dan@codesourcery.com> + + * gdb.texinfo (Expressions): Update description of malloced arrays. + 2008-03-15 Vladimir Prus <vladimir@codesourcery.com> * gdb.texinfo (Thread Commands): Document diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 2ed036c..67c3dee 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -5597,8 +5597,10 @@ you compiled your program to include this information; see @cindex arrays in expressions @value{GDBN} supports array constants in expressions input by the user. The syntax is @{@var{element}, @var{element}@dots{}@}. For example, -you can use the command @code{print @{1, 2, 3@}} to build up an array in -memory that is @code{malloc}ed in the target program. +you can use the command @code{print @{1, 2, 3@}} to create an array +of three integers. If you pass an array to a function or assign it +to a program variable, @value{GDBN} copies the array to memory that +is @code{malloc}ed in the target program. Because C is so widespread, most of the expressions shown in examples in this manual are in C. @xref{Languages, , Using @value{GDBN} with Different |