aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-09-09 12:50:33 -0600
committerTom Tromey <tromey@adacore.com>2023-01-03 08:45:01 -0700
commit7f22044a6b7ce968aacd8b26f608370940ec158d (patch)
tree5e079dae0de1ac5806a5e9d17b01b12f21a296ee /gdb/value.h
parent43f2b4583f95775b2c0fefd71aab4c773c4f7a7e (diff)
downloadbinutils-7f22044a6b7ce968aacd8b26f608370940ec158d.zip
binutils-7f22044a6b7ce968aacd8b26f608370940ec158d.tar.gz
binutils-7f22044a6b7ce968aacd8b26f608370940ec158d.tar.bz2
Introduce value_at_non_lval
In some cases, while a value might be read from memory, gdb should not record the value as being equivalent to that memory. In Ada, the inferior call code will call ada_convert_actual -- and here, if the argument is already in memory, that address will simply be reused. However, for a call like "f(g())", the result of "g" might be on the stack and thus overwritten by the call to "f". This patch introduces a new function that is like value_at but that ensures that the result is non-lvalue.
Diffstat (limited to 'gdb/value.h')
-rw-r--r--gdb/value.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/value.h b/gdb/value.h
index 089af59..1e80b74 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -711,6 +711,10 @@ extern struct value *value_from_component_bitsize (struct value *whole,
extern struct value *value_at (struct type *type, CORE_ADDR addr);
extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr);
+/* Like value_at, but ensures that the result is marked not_lval.
+ This can be important if the memory is "volatile". */
+extern struct value *value_at_non_lval (struct type *type, CORE_ADDR addr);
+
extern struct value *value_from_contents_and_address_unresolved
(struct type *, const gdb_byte *, CORE_ADDR);
extern struct value *value_from_contents_and_address (struct type *,