aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index b841498..42e482b 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -564,6 +564,8 @@ variable: block COLONCOLON name
copy_name ($3));
write_exp_elt_opcode (OP_VAR_VALUE);
+ /* block_found is set by lookup_symbol. */
+ write_exp_elt_block (block_found);
write_exp_elt_sym (sym);
write_exp_elt_opcode (OP_VAR_VALUE); }
;
@@ -620,6 +622,7 @@ variable: qualified_name
if (sym)
{
write_exp_elt_opcode (OP_VAR_VALUE);
+ write_exp_elt_block (NULL);
write_exp_elt_sym (sym);
write_exp_elt_opcode (OP_VAR_VALUE);
break;
@@ -689,6 +692,10 @@ variable: name_not_typename
break;
}
write_exp_elt_opcode (OP_VAR_VALUE);
+ /* We want to use the selected frame, not
+ another more inner frame which happens to
+ be in the same block. */
+ write_exp_elt_block (NULL);
write_exp_elt_sym (sym);
write_exp_elt_opcode (OP_VAR_VALUE);
}