Print nonexisting/optimized out static fields gracefully.
[deliverable/binutils-gdb.git] / gdb / valops.c
index 15fd7c384be4781c1b8d1ff149bf0fa895d3589d..8bff6868100d2b418243741a23d2347c78d61cab 100644 (file)
@@ -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;
@@ -3123,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.024094 seconds and 4 git commands to generate.