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.
This commit is contained in:
parent
93921405a4
commit
67d8990150
5 changed files with 28 additions and 30 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue