This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 08/12] Remove value::next and value::released
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> On 04/05/2018 10:15 PM, Tom Tromey wrote:
>> value_release_to_mark (const struct value *mark)
>> {
Pedro> ...
>> + std::reverse (result.begin (), result.end ());
>> return result;
>> }
Pedro> Is there a comment somewhere mentioning the order of the
Pedro> returned values?
Nope. value.h doesn't generally seem to have comments; but since really
it should, I've done this:
/* Release values from the value chain and return them. Values
created after MARK are released. If MARK is nullptr, or if MARK is
not found on the value chain, then all values are released. Values
are returned in reverse order of creation; that is, newest
first. */
extern std::vector<value_ref_ptr> value_release_to_mark
(const struct value *mark);
Then in value.c I added the usual:
/* See value.h. */
std::vector<value_ref_ptr>
value_release_to_mark (const struct value *mark)
{
...
Tom