/* 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.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "gdb_string.h"
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)
case OP_REGISTER:
{
- int regno = longest_to_int (exp->elts[pc + 1].longconst);
+ const char *name = &exp->elts[pc + 2].string;
+ int regno;
struct value *val;
- (*pos) += 2;
+
+ (*pos) += 3 + BYTES_TO_EXP_ELEM (exp->elts[pc + 1].longconst + 1);
+ regno = frame_map_name_to_regnum (deprecated_safe_get_selected_frame (),
+ name, strlen (name));
+ if (regno == -1)
+ error (_("Register $%s not available."), name);
if (noside == EVAL_AVOID_SIDE_EFFECTS)
val = value_zero (register_type (current_gdbarch, regno), not_lval);
else
val = value_of_register (regno, get_selected_frame (NULL));
if (val == NULL)
- error (_("Value of register %s not available."),
- frame_map_regnum_to_name (get_selected_frame (NULL), regno));
+ error (_("Value of register %s not available."), name);
else
return val;
}
CORE_ADDR selector = 0;
- int using_gcc = 0;
int struct_return = 0;
int sub_no_side = 0;
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)
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
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);