Add gdb.Value.assign method

This adds an 'assign' method to gdb.Value.  This allows for assignment
without requiring the use of parse_and_eval.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
This commit is contained in:
Tom Tromey
2023-05-12 14:10:56 -06:00
parent 510586589e
commit ed80156930
4 changed files with 52 additions and 0 deletions

View File

@@ -947,6 +947,12 @@ If @var{type} is @code{None} then this version of @code{__init__}
behaves as though @var{type} was not passed at all.
@end defun
@defun Value.assign (rhs)
Assign @var{rhs} to this value, and return @code{None}. If this value
cannot be assigned to, or if the assignment is invalid for some reason
(for example a type-checking failure), an exception will be thrown.
@end defun
@defun Value.cast (type)
Return a new instance of @code{gdb.Value} that is the result of
casting this instance to the type described by @var{type}, which must