aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-svr4.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-10-27 22:05:42 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2017-10-27 22:12:01 -0400
commit45461e0dcaf4193b5b4478031f515ffb7911ad85 (patch)
tree204c89fd51a7bf85e51010fabbe9ea9ff92d4dc3 /gdb/solib-svr4.c
parent43dce4394513d15ba8122c3bf442ec1028d93feb (diff)
downloadgdb-45461e0dcaf4193b5b4478031f515ffb7911ad85.zip
gdb-45461e0dcaf4193b5b4478031f515ffb7911ad85.tar.gz
gdb-45461e0dcaf4193b5b4478031f515ffb7911ad85.tar.bz2
Get rid of VEC(probe_p)
Replace the remaining usages of VEC(probe_p) with std::vector. Regtested on the buildbot. gdb/ChangeLog: * probe.h: Don't include gdb_vecs.h. (DEF_VEC_P (probe_p)): Remove. (find_probes_in_objfile): Return an std::vector. * probe.c (find_probes_in_objfile): Likewise. * breakpoint.c (breakpoint_objfile_data) <longjmp_probes>: Change type to std::vector. <exception_probes>: Likewise. (free_breakpoint_probes): Don't manually free vectors. (create_longjmp_master_breakpoint): Adjust. (create_exception_master_breakpoint): Adjust. * solib-svr4.c (svr4_create_probe_breakpoints): Change parameter type, adjust. (svr4_create_solib_event_breakpoints): Adjust.
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r--gdb/solib-svr4.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index bf2577a..5ec606d 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -2075,25 +2075,19 @@ svr4_update_solib_event_breakpoints (void)
static void
svr4_create_probe_breakpoints (struct gdbarch *gdbarch,
- VEC (probe_p) **probes,
+ const std::vector<probe *> *probes,
struct objfile *objfile)
{
- int i;
-
- for (i = 0; i < NUM_PROBES; i++)
+ for (int i = 0; i < NUM_PROBES; i++)
{
enum probe_action action = probe_info[i].action;
- struct probe *probe;
- int ix;
- for (ix = 0;
- VEC_iterate (probe_p, probes[i], ix, probe);
- ++ix)
+ for (probe *p : probes[i])
{
- CORE_ADDR address = get_probe_address (probe, objfile);
+ CORE_ADDR address = get_probe_address (p, objfile);
create_solib_event_breakpoint (gdbarch, address);
- register_solib_event_probe (probe, address, action);
+ register_solib_event_probe (p, address, action);
}
}
@@ -2125,13 +2119,11 @@ svr4_create_solib_event_breakpoints (struct gdbarch *gdbarch,
for (with_prefix = 0; with_prefix <= 1; with_prefix++)
{
- VEC (probe_p) *probes[NUM_PROBES];
+ std::vector<probe *> probes[NUM_PROBES];
int all_probes_found = 1;
int checked_can_use_probe_arguments = 0;
- int i;
- memset (probes, 0, sizeof (probes));
- for (i = 0; i < NUM_PROBES; i++)
+ for (int i = 0; i < NUM_PROBES; i++)
{
const char *name = probe_info[i].name;
struct probe *p;
@@ -2158,7 +2150,7 @@ svr4_create_solib_event_breakpoints (struct gdbarch *gdbarch,
if (strcmp (name, "rtld_map_failed") == 0)
continue;
- if (VEC_empty (probe_p, probes[i]))
+ if (probes[i].empty ())
{
all_probes_found = 0;
break;
@@ -2167,7 +2159,7 @@ svr4_create_solib_event_breakpoints (struct gdbarch *gdbarch,
/* Ensure probe arguments can be evaluated. */
if (!checked_can_use_probe_arguments)
{
- p = VEC_index (probe_p, probes[i], 0);
+ p = probes[i][0];
if (!can_evaluate_probe_arguments (p))
{
all_probes_found = 0;
@@ -2180,9 +2172,6 @@ svr4_create_solib_event_breakpoints (struct gdbarch *gdbarch,
if (all_probes_found)
svr4_create_probe_breakpoints (gdbarch, probes, os->objfile);
- for (i = 0; i < NUM_PROBES; i++)
- VEC_free (probe_p, probes[i]);
-
if (all_probes_found)
return;
}