aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2021-09-10 12:40:54 -0600
committerTom Tromey <tromey@adacore.com>2021-10-05 12:34:55 -0600
commita519e8ffe2b0f008deaef1517562090d9eaadccc (patch)
tree71b6a30706c0849c861c8d38cc25df4954be16fc /gdb/value.h
parent25b0a5714c9ef139bb50adf392154f528d6a4c8d (diff)
downloadfsf-binutils-gdb-a519e8ffe2b0f008deaef1517562090d9eaadccc.zip
fsf-binutils-gdb-a519e8ffe2b0f008deaef1517562090d9eaadccc.tar.gz
fsf-binutils-gdb-a519e8ffe2b0f008deaef1517562090d9eaadccc.tar.bz2
Add lval_funcs::is_optimized_out
This adds an is_optimized_out function pointer to lval_funcs, and changes value_optimized_out to call it. This new function lets gdb determine if a value is optimized out without necessarily fetching the value. This is needed for a subsequent patch, where an attempt to access a lazy value would fail due to the value size limit -- however, the access was only needed to determine the optimized-out state.
Diffstat (limited to 'gdb/value.h')
-rw-r--r--gdb/value.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/value.h b/gdb/value.h
index 3f00444..4501237 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -264,6 +264,12 @@ struct lval_funcs
TOVAL is not considered as an lvalue. */
void (*write) (struct value *toval, struct value *fromval);
+ /* Return true if any part of V is optimized out, false otherwise.
+ This will only be called for lazy values -- if the value has been
+ fetched, then the value's optimized-out bits are consulted
+ instead. */
+ bool (*is_optimized_out) (struct value *v);
+
/* If non-NULL, this is used to implement pointer indirection for
this value. This method may return NULL, in which case value_ind
will fall back to ordinary indirection. */