GNU Binutils with patches for OS216
修订版 | 0fc21fd8cf92de78c3c383378e70a2955e2631c3 (tree) |
---|---|
时间 | 2017-09-10 05:10:50 |
作者 | Tom Tromey <tom@trom...> |
Commiter | Tom Tromey |
Use gdb::def_vector in create_sals_line_offset
This changes create_sals_line_offset to use gdb::def_vector, removing
some cleanups.
ChangeLog
2017-09-09 Tom Tromey <tom@tromey.com>
* linespec.c (create_sals_line_offset): Use gdb::def_vector.
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2017-09-09 Tom Tromey <tom@tromey.com> |
2 | 2 | |
3 | + * linespec.c (create_sals_line_offset): Use gdb::def_vector. | |
4 | + | |
5 | +2017-09-09 Tom Tromey <tom@tromey.com> | |
6 | + | |
3 | 7 | * p-valprint.c (pascal_object_print_value): Use gdb::byte_vector. |
4 | 8 | |
5 | 9 | 2017-09-09 Tom Tromey <tom@tromey.com> |
@@ -45,6 +45,7 @@ | ||
45 | 45 | #include "stack.h" |
46 | 46 | #include "location.h" |
47 | 47 | #include "common/function-view.h" |
48 | +#include "common/def-vector.h" | |
48 | 49 | |
49 | 50 | /* An enumeration of the various things a user might attempt to |
50 | 51 | complete for a linespec location. */ |
@@ -2182,8 +2183,6 @@ create_sals_line_offset (struct linespec_state *self, | ||
2182 | 2183 | else |
2183 | 2184 | { |
2184 | 2185 | struct linetable_entry *best_entry = NULL; |
2185 | - int *filter; | |
2186 | - const struct block **blocks; | |
2187 | 2186 | int i, j; |
2188 | 2187 | |
2189 | 2188 | std::vector<symtab_and_line> intermediate_results |
@@ -2203,10 +2202,8 @@ create_sals_line_offset (struct linespec_state *self, | ||
2203 | 2202 | above, we see if there are other PCs that are in the same |
2204 | 2203 | block. If yes, the other PCs are filtered out. */ |
2205 | 2204 | |
2206 | - filter = XNEWVEC (int, intermediate_results.size ()); | |
2207 | - struct cleanup *cleanup = make_cleanup (xfree, filter); | |
2208 | - blocks = XNEWVEC (const struct block *, intermediate_results.size ()); | |
2209 | - make_cleanup (xfree, blocks); | |
2205 | + gdb::def_vector<int> filter (intermediate_results.size ()); | |
2206 | + gdb::def_vector<const block *> blocks (intermediate_results.size ()); | |
2210 | 2207 | |
2211 | 2208 | for (i = 0; i < intermediate_results.size (); ++i) |
2212 | 2209 | { |
@@ -2245,8 +2242,6 @@ create_sals_line_offset (struct linespec_state *self, | ||
2245 | 2242 | add_sal_to_sals (self, &values, &intermediate_results[i], |
2246 | 2243 | sym ? SYMBOL_NATURAL_NAME (sym) : NULL, 0); |
2247 | 2244 | } |
2248 | - | |
2249 | - do_cleanups (cleanup); | |
2250 | 2245 | } |
2251 | 2246 | |
2252 | 2247 | if (values.empty ()) |