diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2017-09-12 14:15:23 +0200 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2017-09-12 14:15:23 +0200 |
commit | 0782db848b52ecaf29e13d9f12a2c7cfabec2bdb (patch) | |
tree | fa9363f082aa5fc8678fd60e12b247c74dfe2540 /gdb/elfread.c | |
parent | 1eac6bea98f41ee12ba9e750a9578bd8585011c9 (diff) | |
download | gdb-0782db848b52ecaf29e13d9f12a2c7cfabec2bdb.zip gdb-0782db848b52ecaf29e13d9f12a2c7cfabec2bdb.tar.gz gdb-0782db848b52ecaf29e13d9f12a2c7cfabec2bdb.tar.bz2 |
probe: Replace VEC(probe_ops_cp) with std::vector
This patch replaces the usage of VEC to store pointers to probe_ops with
an std::vector. The sole usage of that vector type is one global
variable that holds the ops for the various kinds of probes, so this is
pretty straightforward (no allocation/deallocation issues).
gdb/ChangeLog:
* 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.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r-- | gdb/elfread.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c index 8a64865..436d9b5 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -1319,15 +1319,12 @@ elf_get_probes (struct objfile *objfile) 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); } |