aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/ada-lang.c2
-rw-r--r--gdb/value.c6
-rw-r--r--gdb/value.h8
4 files changed, 22 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c4d3870..b24b988 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2013-07-09 Pedro Alves <palves@redhat.com>
+
+ Checked in by Joel Brobecker <brobecker@adacore.com>.
+ * ada-lang.c (coerce_unspec_val_to_type): Use
+ value_optimized_out_const.
+ * value.c (value_optimized_out_const): New function.
+ * value.h (value_optimized_out_const): New declaration.
+
2013-07-09 Doug Evans <dje@google.com>
* defs.h (enum val_prettyformat): Renamed from val_prettyprint.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 8240fee..dc5f2b6 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -581,7 +581,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type)
set_value_bitsize (result, value_bitsize (val));
set_value_bitpos (result, value_bitpos (val));
set_value_address (result, value_address (val));
- set_value_optimized_out (result, value_optimized_out (val));
+ set_value_optimized_out (result, value_optimized_out_const (val));
return result;
}
}
diff --git a/gdb/value.c b/gdb/value.c
index ce4b13a..04f325f 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1062,6 +1062,12 @@ value_optimized_out (struct value *value)
return value->optimized_out;
}
+int
+value_optimized_out_const (const struct value *value)
+{
+ return value->optimized_out;
+}
+
void
set_value_optimized_out (struct value *value, int val)
{
diff --git a/gdb/value.h b/gdb/value.h
index 44d2aa0..5e00c89 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -319,10 +319,16 @@ extern int value_fetch_lazy (struct value *val);
extern int value_contents_equal (struct value *val1, struct value *val2);
/* If nonzero, this is the value of a variable which does not actually
- exist in the program. */
+ exist in the program, at least partially. If the value is lazy,
+ this may fetch it now. */
extern int value_optimized_out (struct value *value);
extern void set_value_optimized_out (struct value *value, int val);
+/* Like value_optimized_out, but don't fetch the value even if it is
+ lazy. Mainly useful for constructing other values using VALUE as
+ template. */
+extern int value_optimized_out_const (const struct value *value);
+
/* Like value_optimized_out, but return false if any bit in the object
is valid. */
extern int value_entirely_optimized_out (const struct value *value);