Print nonexisting/optimized out static fields gracefully.
[deliverable/binutils-gdb.git] / gdb / value.c
index d96d285cbdd3ab3a165714498c14d2ea4d10835c..1f562f52d4a934bcfa44882ed5a26704c0b7a40c 100644 (file)
@@ -2590,8 +2590,7 @@ unpack_pointer (struct type *type, const gdb_byte *valaddr)
 
 \f
 /* Get the value of the FIELDNO'th field (which must be static) of
-   TYPE.  Return NULL if the field doesn't exist or has been
-   optimized out.  */
+   TYPE.  */
 
 struct value *
 value_static_field (struct type *type, int fieldno)
@@ -2618,7 +2617,7 @@ value_static_field (struct type *type, int fieldno)
                                                               NULL, NULL);
 
          if (!msym)
-           return NULL;
+           return allocate_optimized_out_value (type);
          else
            {
              retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
This page took 0.025149 seconds and 4 git commands to generate.