DWARF: handle non-local references in nested functions
[deliverable/binutils-gdb.git] / gdb / printcmd.c
index f51e25cbbb949e4e787e908629bc408157406257..553cc71bf916a4c3838bf18e86eaae7d641ce35b 100644 (file)
@@ -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);
This page took 0.024282 seconds and 4 git commands to generate.