aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-04-06 16:38:56 -0600
committerTom Tromey <tom@tromey.com>2017-04-12 11:16:17 -0600
commit67d89901506da74d00a482b7560237dce404b41c (patch)
tree9c9c308fbaabb9ac805325be91bd2f75a07e040e /gdb/linespec.c
parent93921405a46c0a58eae19fffb92e02416082801a (diff)
downloadgdb-67d89901506da74d00a482b7560237dce404b41c.zip
gdb-67d89901506da74d00a482b7560237dce404b41c.tar.gz
gdb-67d89901506da74d00a482b7560237dce404b41c.tar.bz2
Change find_pcs_for_symtab_line to return a std::vector
This changes find_pcs_for_symtab_line to return a std::vector. This allows the removal of some cleanups. gdb/ChangeLog 2017-04-12 Tom Tromey <tom@tromey.com> * symtab.h (find_pcs_for_symtab_line): Change return type. * symtab.c (find_pcs_for_symtab_line): Change return type. * python/py-linetable.c (build_line_table_tuple_from_pcs): Change type of "vec". Update. (ltpy_get_pcs_for_line): Update. * linespec.c (decode_digits_ordinary): Update.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 41b82d7..bccabaf 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -3469,9 +3469,7 @@ decode_digits_ordinary (struct linespec_state *self,
for (ix = 0; VEC_iterate (symtab_ptr, ls->file_symtabs, ix, elt); ++ix)
{
- int i;
- VEC (CORE_ADDR) *pcs;
- CORE_ADDR pc;
+ std::vector<CORE_ADDR> pcs;
/* The logic above should ensure this. */
gdb_assert (elt != NULL);
@@ -3479,7 +3477,7 @@ decode_digits_ordinary (struct linespec_state *self,
set_current_program_space (SYMTAB_PSPACE (elt));
pcs = find_pcs_for_symtab_line (elt, line, best_entry);
- for (i = 0; VEC_iterate (CORE_ADDR, pcs, i, pc); ++i)
+ for (CORE_ADDR pc : pcs)
{
struct symtab_and_line sal;
@@ -3490,8 +3488,6 @@ decode_digits_ordinary (struct linespec_state *self,
sal.pc = pc;
add_sal_to_sals_basic (sals, &sal);
}
-
- VEC_free (CORE_ADDR, pcs);
}
}