diff options
author | Tom Tromey <tom@tromey.com> | 2023-01-31 13:45:40 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-02-13 15:21:08 -0700 |
commit | bbe912ba8898f5440028a35d0a206d70a6877ed6 (patch) | |
tree | 0ffc199020a35bd2968ce1a69d3686737eca7933 /gdb/value.h | |
parent | ee7bb2944b75ce482dbf3bdb2d396efc98f1cf89 (diff) | |
download | gdb-bbe912ba8898f5440028a35d0a206d70a6877ed6.zip gdb-bbe912ba8898f5440028a35d0a206d70a6877ed6.tar.gz gdb-bbe912ba8898f5440028a35d0a206d70a6877ed6.tar.bz2 |
Turn some value_contents functions into methods
This turns value_contents_raw, value_contents_writeable, and
value_contents_all_raw into methods on value. The remaining functions
will be changed later in the series; they were a bit trickier and so I
didn't include them in this patch.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/value.h')
-rw-r--r-- | gdb/value.h | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/gdb/value.h b/gdb/value.h index 4213a55..66074a1 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -370,6 +370,22 @@ public: int *deprecated_regnum_hack (); + /* contents() and contents_raw() both return the address of the gdb + buffer used to hold a copy of the contents of the lval. + contents() is used when the contents of the buffer are needed -- + it uses fetch_lazy() to load the buffer from the process being + debugged if it hasn't already been loaded (contents_writeable() + is used when a writeable but fetched buffer is required).. + contents_raw() is used when data is being stored into the buffer, + or when it is certain that the contents of the buffer are valid. + + Note: The contents pointer is adjusted by the offset required to + get to the real subobject, if the value happens to represent + something embedded in a larger run-time object. */ + gdb::array_view<gdb_byte> contents_raw (); + gdb::array_view<gdb_byte> contents_all_raw (); + gdb::array_view<gdb_byte> contents_writeable (); + /* Type of value; either not an lval, or one of the various different possible kinds of lval. */ @@ -636,22 +652,6 @@ struct lval_funcs extern void error_value_optimized_out (void); -/* value_contents() and value_contents_raw() both return the address - of the gdb buffer used to hold a copy of the contents of the lval. - value_contents() is used when the contents of the buffer are needed - -- it uses value_fetch_lazy() to load the buffer from the process - being debugged if it hasn't already been loaded - (value_contents_writeable() is used when a writeable but fetched - buffer is required).. value_contents_raw() is used when data is - being stored into the buffer, or when it is certain that the - contents of the buffer are valid. - - Note: The contents pointer is adjusted by the offset required to - get to the real subobject, if the value happens to represent - something embedded in a larger run-time object. */ - -extern gdb::array_view<gdb_byte> value_contents_raw (struct value *); - /* 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 @@ -659,12 +659,10 @@ extern gdb::array_view<gdb_byte> value_contents_raw (struct value *); declared here. */ extern gdb::array_view<const gdb_byte> value_contents (struct value *); -extern gdb::array_view<gdb_byte> value_contents_writeable (struct value *); /* The ALL variants of the above two macros do not adjust the returned pointer by the embedded_offset value. */ -extern gdb::array_view<gdb_byte> value_contents_all_raw (struct value *); extern gdb::array_view<const gdb_byte> value_contents_all (struct value *); /* Like value_contents_all, but does not require that the returned |