diff options
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r-- | gdb/printcmd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c index f51e25c..553cc71 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1988,7 +1988,11 @@ print_variable_and_value (const char *name, struct symbol *var, struct value *val; struct value_print_options opts; - val = read_var_value (var, frame); + /* READ_VAR_VALUE needs a block in order to deal with non-local + references (i.e. to handle nested functions). In this context, we + print variables that are local to this frame, so we can avoid passing + a block to it. */ + val = read_var_value (var, NULL, frame); get_user_print_options (&opts); opts.deref_ref = 1; common_val_print (val, stream, indent, &opts, current_language); |