* gdbcore.h (struct regcache): Add forward declaration.
[deliverable/binutils-gdb.git] / gdb / valops.c
index 19c80c938fb21b9b15d84099293f22d8737762bd..d7ecb2a32c621188fa6d417aa76be67f98723476 100644 (file)
@@ -1,8 +1,7 @@
 /* Perform non-arithmetic operations on values, for GDB.
 
-   Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
-   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-   2006
+   Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -579,7 +578,7 @@ value_assign (struct value *toval, struct value *fromval)
   /* Since modifying a register can trash the frame chain, and modifying memory
      can trash the frame cache, we save the old frame and then restore the new
      frame afterwards.  */
-  old_frame = get_frame_id (deprecated_selected_frame);
+  old_frame = get_frame_id (deprecated_safe_get_selected_frame ());
 
   switch (VALUE_LVAL (toval))
     {
@@ -935,7 +934,7 @@ value_ind (struct value *arg1)
      BUILTIN_TYPE_LONGEST would seem to be a mistake.  */
   if (TYPE_CODE (base_type) == TYPE_CODE_INT)
     return value_at_lazy (builtin_type_int,
-                         (CORE_ADDR) value_as_long (arg1));
+                         (CORE_ADDR) value_as_address (arg1));
   else if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
     {
       struct type *enc_type;
@@ -2668,16 +2667,18 @@ value_of_local (const char *name, int complain)
   struct symbol *func, *sym;
   struct block *b;
   struct value * ret;
+  struct frame_info *frame;
 
-  if (deprecated_selected_frame == 0)
+  if (complain)
+    frame = get_selected_frame (_("no frame selected"));
+  else
     {
-      if (complain)
-       error (_("no frame selected"));
-      else
+      frame = deprecated_safe_get_selected_frame ();
+      if (frame == 0)
        return 0;
     }
 
-  func = get_frame_function (deprecated_selected_frame);
+  func = get_frame_function (frame);
   if (!func)
     {
       if (complain)
@@ -2706,7 +2707,7 @@ value_of_local (const char *name, int complain)
        return NULL;
     }
 
-  ret = read_var_value (sym, deprecated_selected_frame);
+  ret = read_var_value (sym, frame);
   if (ret == 0 && complain)
     error (_("`%s' argument unreadable"), name);
   return ret;
This page took 0.132366 seconds and 4 git commands to generate.