X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fvalue.c;h=004ff3b9a9d1a202cc78249b23c170101150f29e;hb=a6535de1903d9caad8c10c1d81c51a29612456a6;hp=a84c196aaaae4e9b6bb7545355490c5e7f19fd08;hpb=b562120198d9fa2c191823508813daa3b62a3a37;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/value.c b/gdb/value.c index a84c196aaa..004ff3b9a9 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -1638,20 +1638,6 @@ value_free_to_mark (const struct value *mark) all_values = val; } -/* Frees all the elements in a chain of values. */ - -void -free_value_chain (struct value *v) -{ - struct value *next; - - for (; v; v = next) - { - next = value_next (v); - value_decref (v); - } -} - /* Remove VAL from the chain all_values so it will not be freed automatically. */ @@ -1695,25 +1681,30 @@ release_value (struct value *val) return value_ref_ptr (val); } -/* Release all values up to mark */ -struct value * +/* See value.h. */ + +std::vector value_release_to_mark (const struct value *mark) { - struct value *val; + std::vector result; struct value *next; - for (val = next = all_values; next; next = next->next) + for (next = all_values; next; next = next->next) { + next->released = 1; + result.emplace_back (next); + if (next->next == mark) { - all_values = next->next; + struct value *save = next->next; next->next = NULL; - return val; + next = save; + break; } - next->released = 1; } - all_values = 0; - return val; + + all_values = next; + return result; } /* Return a copy of the value ARG.