2003-06-11 David Carlton <carlton@bactrian.org>
[deliverable/binutils-gdb.git] / gdb / valops.c
index d8261c822f0132957ed192f196ca509f3d65178e..8be9ce62084e0a5f8982b0575b64c3bf49edfb5d 100644 (file)
@@ -35,6 +35,7 @@
 #include "cp-abi.h"
 #include "block.h"
 #include "infcall.h"
+#include "dictionary.h"
 
 #include <errno.h>
 #include "gdb_string.h"
@@ -87,7 +88,7 @@ struct value *
 find_function_in_inferior (const char *name)
 {
   register struct symbol *sym;
-  sym = lookup_symbol (name, 0, VAR_NAMESPACE, 0, NULL);
+  sym = lookup_symbol (name, 0, VAR_DOMAIN, 0, NULL);
   if (sym != NULL)
     {
       if (SYMBOL_CLASS (sym) != LOC_BLOCK)
@@ -480,7 +481,7 @@ value_assign (struct value *toval, struct value *fromval)
 {
   register struct type *type;
   struct value *val;
-  char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+  char raw_buffer[MAX_REGISTER_SIZE];
   int use_buffer = 0;
   struct frame_id old_frame;
 
@@ -605,10 +606,7 @@ value_assign (struct value *toval, struct value *fromval)
          }
        else
          {
-           for (frame = get_current_frame ();
-                frame && get_frame_base (frame) != VALUE_FRAME (toval);
-                frame = get_prev_frame (frame))
-             ;
+           frame = frame_find_by_id (VALUE_FRAME_ID (toval));
            value_reg = VALUE_FRAME_REGNUM (toval);
          }
 
@@ -634,8 +632,7 @@ value_assign (struct value *toval, struct value *fromval)
          amount_to_copy = byte_offset + TYPE_LENGTH (type);
 
        /* And a bounce buffer.  Be slightly over generous.  */
-       buffer = (char *) alloca (amount_to_copy
-                                 + MAX_REGISTER_RAW_SIZE);
+       buffer = (char *) alloca (amount_to_copy + MAX_REGISTER_SIZE);
 
        /* Copy it in.  */
        for (regno = reg_offset, amount_copied = 0;
@@ -962,8 +959,8 @@ value_ind (struct value *arg1)
 CORE_ADDR
 push_word (CORE_ADDR sp, ULONGEST word)
 {
-  register int len = REGISTER_SIZE;
-  char *buffer = alloca (MAX_REGISTER_RAW_SIZE);
+  register int len = DEPRECATED_REGISTER_SIZE;
+  char buffer[MAX_REGISTER_SIZE];
 
   store_unsigned_integer (buffer, len, word);
   if (INNER_THAN (1, 2))
@@ -2351,7 +2348,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
          else
            {
              struct symbol *s = lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j),
-                                               0, VAR_NAMESPACE, 0, NULL);
+                                               0, VAR_DOMAIN, 0, NULL);
              if (s == NULL)
                {
                  v = 0;
@@ -2479,7 +2476,6 @@ value_of_local (const char *name, int complain)
 {
   struct symbol *func, *sym;
   struct block *b;
-  int i;
   struct value * ret;
 
   if (deprecated_selected_frame == 0)
@@ -2500,8 +2496,7 @@ value_of_local (const char *name, int complain)
     }
 
   b = SYMBOL_BLOCK_VALUE (func);
-  i = BLOCK_NSYMS (b);
-  if (i <= 0)
+  if (dict_empty (BLOCK_DICT (b)))
     {
       if (complain)
        error ("no args, no `%s'", name);
@@ -2511,7 +2506,7 @@ value_of_local (const char *name, int complain)
 
   /* Calling lookup_block_symbol is necessary to get the LOC_REGISTER
      symbol instead of the LOC_ARG one (if both exist).  */
-  sym = lookup_block_symbol (b, name, NULL, VAR_NAMESPACE);
+  sym = lookup_block_symbol (b, name, NULL, VAR_DOMAIN);
   if (sym == NULL)
     {
       if (complain)
This page took 0.026047 seconds and 4 git commands to generate.