diff options
author | Caroline Tice <cmtice@google.com> | 2007-05-18 19:42:42 +0000 |
---|---|---|
committer | Caroline Tice <cmtice@google.com> | 2007-05-18 19:42:42 +0000 |
commit | 42be36b328ae784ae6981da7c7cab95b67ed7737 (patch) | |
tree | 5b0a0ffb49db6fe2d5c149e62e5d84f2c9de39b7 /gdb/value.c | |
parent | a7c569c8f08b3485034e771a5e49cce0e23ca2b2 (diff) | |
download | gdb-42be36b328ae784ae6981da7c7cab95b67ed7737.zip gdb-42be36b328ae784ae6981da7c7cab95b67ed7737.tar.gz gdb-42be36b328ae784ae6981da7c7cab95b67ed7737.tar.bz2 |
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.
Diffstat (limited to 'gdb/value.c')
-rw-r--r-- | gdb/value.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/value.c b/gdb/value.c index d31a5f4..26ba2a4 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -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) { |