* symtab.c (find_pc_sect_line): Use SYMBOL_VALUE_ADDRESS instead
[deliverable/binutils-gdb.git] / gdb / eval.c
index 0fb320e4474c9faa074f5d05e77b27046e5e44c8..1f84d23d2fb4be5c48c79bf6fe97922a7944e853 100644 (file)
@@ -1,7 +1,7 @@
 /* Evaluate expressions for GDB.
 
    Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007
+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -456,6 +456,11 @@ evaluate_subexp_standard (struct type *expect_type,
       return value_from_double (exp->elts[pc + 1].type,
                                exp->elts[pc + 2].doubleconst);
 
+    case OP_DECFLOAT:
+      (*pos) += 3;
+      return value_from_decfloat (expect_type, exp->elts[pc + 1].type,
+                               exp->elts[pc + 2].decfloatconst);
+
     case OP_VAR_VALUE:
       (*pos) += 3;
       if (noside == EVAL_SKIP)
@@ -760,7 +765,6 @@ evaluate_subexp_standard (struct type *expect_type,
 
        CORE_ADDR selector = 0;
 
-       int using_gcc = 0;
        int struct_return = 0;
        int sub_no_side = 0;
 
@@ -912,9 +916,6 @@ evaluate_subexp_standard (struct type *expect_type,
 
            b = block_for_pc (funaddr);
 
-           /* If compiled without -g, assume GCC 2.  */
-           using_gcc = (b == NULL ? 2 : BLOCK_GCC_COMPILED (b));
-
            CHECK_TYPEDEF (value_type);
          
            if ((value_type == NULL) 
@@ -924,11 +925,11 @@ evaluate_subexp_standard (struct type *expect_type,
                  value_type = expect_type;
              }
 
-           struct_return = using_struct_return (value_type, using_gcc);
+           struct_return = using_struct_return (value_type);
          }
        else if (expect_type != NULL)
          {
-           struct_return = using_struct_return (check_typedef (expect_type), using_gcc);
+           struct_return = using_struct_return (check_typedef (expect_type));
          }
        
        /* Found a function symbol.  Now we will substitute its
@@ -2149,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);
This page took 0.026347 seconds and 4 git commands to generate.