Add ability to report when a variable's value is uninitialized,

based on information provided by the compiler.  Also add new
DWARF OP, DW_OP_GNU_uninit, for this purpose.
This commit is contained in:
Caroline Tice
2007-05-18 19:42:42 +00:00
parent a7c569c8f0
commit 42be36b328
8 changed files with 70 additions and 1 deletions

View File

@@ -157,6 +157,9 @@ struct value
actually exist in the program. */
char optimized_out;
/* If value is a variable, is it initialized or not. */
int initialized;
/* Actual contents of the value. For use of this value; setting it
uses the stuff above. Not valid if lazy is nonzero. Target
byte-order. We force it to be aligned properly for any possible
@@ -232,6 +235,7 @@ allocate_value (struct type *type)
val->embedded_offset = 0;
val->pointed_to_offset = 0;
val->modifiable = 1;
val->initialized = 1; /* Default to initialized. */
return val;
}
@@ -1699,6 +1703,22 @@ using_struct_return (struct type *value_type, int gcc_p)
!= RETURN_VALUE_REGISTER_CONVENTION);
}
/* Set the initialized field in a value struct. */
void
set_value_initialized (struct value *val, int status)
{
val->initialized = status;
}
/* Return the initialized field in a value struct. */
int
value_initialized (struct value *val)
{
return val->initialized;
}
void
_initialize_values (void)
{