* python/py-frame.c (frapy_block): Fix error message text.
[deliverable/binutils-gdb.git] / gdb / valops.c
index f86b2835d548a82cde5a948de3363843f001ce27..4fc57ec32af20440e1e11cb6f359f2b3dca401ac 100644 (file)
@@ -37,7 +37,7 @@
 #include "dfp.h"
 #include "tracepoint.h"
 #include <errno.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "cp-support.h"
 #include "observer.h"
@@ -1853,13 +1853,7 @@ do_search_struct_field (const char *name, struct value *arg1, int offset,
            struct value *v;
 
            if (field_is_static (&TYPE_FIELD (type, i)))
-             {
-               v = value_static_field (type, i);
-               if (v == 0)
-                 error (_("field %s is nonexistent or "
-                          "has been optimized out"),
-                        name);
-             }
+             v = value_static_field (type, i);
            else
              v = value_primitive_field (arg1, offset, i, type);
            *result_ptr = v;
@@ -1950,14 +1944,12 @@ do_search_struct_field (const char *name, struct value *arg1, int offset,
            {
              CORE_ADDR base_addr;
 
-             v2  = allocate_value (basetype);
              base_addr = value_address (arg1) + boffset;
+             v2 = value_at_lazy (basetype, base_addr);
              if (target_read_memory (base_addr, 
                                      value_contents_raw (v2),
-                                     TYPE_LENGTH (basetype)) != 0)
+                                     TYPE_LENGTH (value_type (v2))) != 0)
                error (_("virtual baseclass botch"));
-             VALUE_LVAL (v2) = lval_memory;
-             set_value_address (v2, base_addr);
            }
          else
            {
@@ -3125,9 +3117,6 @@ value_struct_elt_for_reference (struct type *domain, int offset,
          if (field_is_static (&TYPE_FIELD (t, i)))
            {
              v = value_static_field (t, i);
-             if (v == NULL)
-               error (_("static field %s has been optimized out"),
-                      name);
              if (want_address)
                v = value_addr (v);
              return v;
This page took 0.023968 seconds and 4 git commands to generate.