aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-09-06 16:16:38 -0600
committerTom Tromey <tom@tromey.com>2017-09-09 14:10:50 -0600
commit0fc21fd8cf92de78c3c383378e70a2955e2631c3 (patch)
tree225237d8a12f4bf81c2c2e112506aa778b5ce32d /gdb/linespec.c
parent49663d051c70e1366f9b94f586459a329e9b7053 (diff)
downloadgdb-0fc21fd8cf92de78c3c383378e70a2955e2631c3.zip
gdb-0fc21fd8cf92de78c3c383378e70a2955e2631c3.tar.gz
gdb-0fc21fd8cf92de78c3c383378e70a2955e2631c3.tar.bz2
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.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 4801808..abe6615 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -45,6 +45,7 @@
#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. */
@@ -2182,8 +2183,6 @@ create_sals_line_offset (struct linespec_state *self,
else
{
struct linetable_entry *best_entry = NULL;
- int *filter;
- const struct block **blocks;
int i, j;
std::vector<symtab_and_line> intermediate_results
@@ -2203,10 +2202,8 @@ create_sals_line_offset (struct linespec_state *self,
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)
{
@@ -2245,8 +2242,6 @@ create_sals_line_offset (struct linespec_state *self,
add_sal_to_sals (self, &values, &intermediate_results[i],
sym ? SYMBOL_NATURAL_NAME (sym) : NULL, 0);
}
-
- do_cleanups (cleanup);
}
if (values.empty ())