2017-09-12 Simon Marchi <simon.marchi@ericsson.com>
+ * probe.h (probe_ops_cp): Remove typedef.
+ (DEF_VEC_P (probe_ops_cp)): Remove.
+ (all_probe_ops): Change type to std::vector.
+ * probe.c (info_probes_for_ops): Adjust to vector change.
+ (probe_linespec_to_ops): Likewise.
+ (all_probe_ops): Change type to std::vector.
+ (_initialize_probe): Adjust to vector change.
+ * dtrace-probe.c (_initialize_dtrace_probe): Likewise.
+ * elfread.c (elf_get_probes): Likewise.
+ * stap-probe.c (_initialize_stap_probe): Likewise.
+
+2017-09-12 Simon Marchi <simon.marchi@ericsson.com>
+
* probe.h (struct bound_probe): Define constructors.
* probe.c (bound_probe_s): Remove typedef.
(DEF_VEC_O (bound_probe_s)): Remove VEC.
if (probes_per_bfd == NULL)
{
- int ix;
- const struct probe_ops *probe_ops;
probes_per_bfd = new std::vector<probe *>;
/* Here we try to gather information about all types of probes from the
objfile. */
- for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, probe_ops);
- ix++)
- probe_ops->get_probes (probes_per_bfd, objfile);
+ for (const probe_ops *ops : all_probe_ops)
+ ops->get_probes (probes_per_bfd, objfile);
set_bfd_data (objfile->obfd, probe_key, probes_per_bfd);
}
if (pops == NULL)
{
- const struct probe_ops *po;
- int ix;
-
/* If the probe_ops is NULL, it means the user has requested a "simple"
`info probes', i.e., she wants to print all information about all
probes. For that, we have to identify how many extra fields we will
that number. But note that we ignore the probe_ops for which no probes
are defined with the given search criteria. */
- for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, po); ++ix)
+ for (const probe_ops *po : all_probe_ops)
if (exists_probe_with_pops (probes, po))
ui_out_extra_fields += get_number_extra_fields (po);
}
if (pops == NULL)
{
- const struct probe_ops *po;
- int ix;
-
/* We have to generate the table header for each new probe type
that we will print. Note that this excludes probe types not
having any defined probe with the search criteria. */
- for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, po); ++ix)
+ for (const probe_ops *po : all_probe_ops)
if (exists_probe_with_pops (probes, po))
gen_ui_out_table_header_info (probes, po);
}
if (pops == NULL)
{
- const struct probe_ops *po;
- int ix;
-
- for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, po);
- ++ix)
+ for (const probe_ops *po : all_probe_ops)
if (probe.probe->pops == po)
print_ui_out_info (probe.probe);
else if (exists_probe_with_pops (probes, po))
const struct probe_ops *
probe_linespec_to_ops (const char **linespecp)
{
- int ix;
- const struct probe_ops *probe_ops;
-
- for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, probe_ops); ix++)
- if (probe_ops->is_linespec (linespecp))
- return probe_ops;
+ for (const probe_ops *ops : all_probe_ops)
+ if (ops->is_linespec (linespecp))
+ return ops;
return NULL;
}
};
-VEC (probe_ops_cp) *all_probe_ops;
+std::vector<const probe_ops *> all_probe_ops;
void
_initialize_probe (void)
{
- VEC_safe_push (probe_ops_cp, all_probe_ops, &probe_ops_any);
+ all_probe_ops.push_back (&probe_ops_any);
create_internalvar_type_lazy ("_probe_argc", &probe_funcs,
(void *) (uintptr_t) -1);