diff options
author | Tom Tromey <tromey@adacore.com> | 2019-11-05 10:12:27 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-11-14 11:58:50 -0700 |
commit | 55708e99aca33f2ee9036732d778cd5899d2a2b0 (patch) | |
tree | e62533e80ec25aa545539f243bb34d82ec125821 /gdb/python/py-block.c | |
parent | 6b92c0d3533b8b01970e6ba5aa92581e027a63c2 (diff) | |
download | binutils-55708e99aca33f2ee9036732d778cd5899d2a2b0.zip binutils-55708e99aca33f2ee9036732d778cd5899d2a2b0.tar.gz binutils-55708e99aca33f2ee9036732d778cd5899d2a2b0.tar.bz2 |
Allow re-assigning to convenience variables
A customer reported somewhat odd gdb behavior, where re-assigning an
array or string to a convenience variable would yield "Too many array
elements". A test case is:
(gdb) p $x = "x"
(gdb) p $x = "xyz"
This patch fixes the problem by making a special case in the evaluator
for assignment to convenience variables, which seems like the correct
behavior.
Note that a previous patch implemented this for Ada, see commit
f411722cb ("Allow re-assigning to convenience variables").
gdb/ChangeLog
2019-11-14 Tom Tromey <tromey@adacore.com>
* eval.c (evaluate_subexp_standard) <BINOP_ASSIGN>: Do not pass an
expected type for the RHS if the LHS is a convenience variable.
gdb/testsuite/ChangeLog
2019-11-14 Tom Tromey <tromey@adacore.com>
* gdb.base/gdbvars.exp (test_convenience_variables): Add
regression tests.
Change-Id: I5e66a2d243931a5c43c7af4bc9f6717464c2477e
Diffstat (limited to 'gdb/python/py-block.c')
0 files changed, 0 insertions, 0 deletions