+2017-09-09 Tom Tromey <tom@tromey.com>
+
+ * linespec.c (create_sals_line_offset): Use gdb::def_vector.
+
2017-09-09 Tom Tromey <tom@tromey.com>
* p-valprint.c (pascal_object_print_value): Use gdb::byte_vector.
#include "stack.h"
#include "location.h"
#include "common/function-view.h"
+#include "common/def-vector.h"
/* An enumeration of the various things a user might attempt to
complete for a linespec location. */
else
{
struct linetable_entry *best_entry = NULL;
- int *filter;
- const struct block **blocks;
int i, j;
std::vector<symtab_and_line> intermediate_results
above, we see if there are other PCs that are in the same
block. If yes, the other PCs are filtered out. */
- filter = XNEWVEC (int, intermediate_results.size ());
- struct cleanup *cleanup = make_cleanup (xfree, filter);
- blocks = XNEWVEC (const struct block *, intermediate_results.size ());
- make_cleanup (xfree, blocks);
+ gdb::def_vector<int> filter (intermediate_results.size ());
+ gdb::def_vector<const block *> blocks (intermediate_results.size ());
for (i = 0; i < intermediate_results.size (); ++i)
{
add_sal_to_sals (self, &values, &intermediate_results[i],
sym ? SYMBOL_NATURAL_NAME (sym) : NULL, 0);
}
-
- do_cleanups (cleanup);
}
if (values.empty ())