summaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-10-09 19:36:06 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-10-09 19:36:06 +0000
commitf321706994c9c6ee8b0af4f2dfa9577890436f1f (patch)
treee12ff61d22936332f3c8b0c949bdf0981f3d3c9d /gdb/valops.c
parent4435e72496385a2a7ff59f072aee2014de46314a (diff)
downloadgdb-f321706994c9c6ee8b0af4f2dfa9577890436f1f.tar.gz
gdb/
Make some lval_funcs methods to default on NULL. * valops.c (value_fetch_lazy): Check if lval_computed read method is NULL. (value_assign): Check if lval_computed write method is NULL. * value.h (struct lval_funcs): Comment NULL values for read and write methods.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index 32d71cdf86f..e88e9dc0c08 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1110,7 +1110,8 @@ value_fetch_lazy (struct value *val)
watchpoints from trying to watch the saved frame pointer. */
value_free_to_mark (mark);
}
- else if (VALUE_LVAL (val) == lval_computed)
+ else if (VALUE_LVAL (val) == lval_computed
+ && value_computed_funcs (val)->read != NULL)
value_computed_funcs (val)->read (val);
else if (value_optimized_out (val))
/* Keep it optimized out. */;
@@ -1381,9 +1382,13 @@ value_assign (struct value *toval, struct value *fromval)
{
const struct lval_funcs *funcs = value_computed_funcs (toval);
- funcs->write (toval, fromval);
+ if (funcs->write != NULL)
+ {
+ funcs->write (toval, fromval);
+ break;
+ }
}
- break;
+ /* Fall through. */
default:
error (_("Left operand of assignment is not an lvalue."));