* eval.c (evaluate_subexp_for_address): Provide frame address to
authorJoel Brobecker <brobecker@gnat.com>
Thu, 3 Jan 2008 04:11:16 +0000 (04:11 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Thu, 3 Jan 2008 04:11:16 +0000 (04:11 +0000)
        locate_var_value only if it will be needed.

gdb/ChangeLog
gdb/eval.c

index 803027e826889e8ee12343e334c985837972bd2d..484e57c82c66699a3f3eef315d58152d808ac63f 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-03  Paul N. Hilfinger  <hilfinger@adacore.com>
+
+       * eval.c (evaluate_subexp_for_address): Provide frame address to
+       locate_var_value only if it will be needed.
+
 2008-01-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * linux-nat.c (linux_child_follow_fork): Call also CHECK_FOR_THREAD_DB.
index d5c63db920eb943249657130599cecc3105c1c9d..1f84d23d2fb4be5c48c79bf6fe97922a7944e853 100644 (file)
@@ -2150,11 +2150,13 @@ evaluate_subexp_for_address (struct expression *exp, int *pos,
          return
            value_zero (type, not_lval);
        }
-      else
+      else if (symbol_read_needs_frame (var))
        return
          locate_var_value
          (var,
           block_innermost_frame (exp->elts[pc + 1].block));
+      else
+       return locate_var_value (var, NULL);
 
     case OP_SCOPE:
       tem = longest_to_int (exp->elts[pc + 2].longconst);