summaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-11-08 15:26:47 +0000
committerPedro Alves <palves@redhat.com>2016-11-08 15:26:47 +0000
commit3cde5c42d1c1ddcf8bbde5c47233c644370c959c (patch)
tree887cf692d863e70717f3a3f957f99d82469ccee5 /gdb/breakpoint.c
parent833177a4a5c1a2a6cabe70bfe35ecf241b68d169 (diff)
downloadbinutils-gdb-3cde5c42d1c1ddcf8bbde5c47233c644370c959c.tar.gz
Eliminate agent_expr_p; VEC -> std::vector in struct bp_target_info
After the previous patch, we end up with these two types with quite similar, and potentially confusing names: typedef gdb::unique_ptr<agent_expr> agent_expr_up; /* Pointer to an agent_expr structure. */ typedef struct agent_expr *agent_expr_p; The latter is only necessary to put agent_expr pointers in VECs. So just eliminate it and use std::vector instead. gdb/ChangeLog: 2016-11-08 Pedro Alves <palves@redhat.com> * ax.h (agent_expr_p): Delete. (DEF_VEC_P (agent_expr_p)): Delete. * breakpoint.c (build_target_condition_list) (build_target_command_list): Adjust to use of std::vector. (bp_location_dtor): Remove now unnecessary VEC_free calls. * breakpoint.h: Include <vector>. (struct bp_target_info) <conditions, tcommands>: Now std::vector's. * remote.c (remote_add_target_side_condition): bp_tgt->conditions is now a std::vector; adjust. (remote_add_target_side_commands, remote_insert_breakpoint): bp_tgt->tcommands is now a std::vector; adjust.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index c8831456d23..a3a81f71c67 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -2298,7 +2298,7 @@ build_target_condition_list (struct bp_location *bl)
struct bp_location *loc;
/* Release conditions left over from a previous insert. */
- VEC_free (agent_expr_p, bl->target_info.conditions);
+ bl->target_info.conditions.clear ();
/* This is only meaningful if the target is
evaluating conditions and if the user has
@@ -2371,10 +2371,11 @@ build_target_condition_list (struct bp_location *bl)
&& loc->pspace->num == bl->pspace->num
&& loc->owner->enable_state == bp_enabled
&& loc->enabled)
- /* Add the condition to the vector. This will be used later to send the
- conditions to the target. */
- VEC_safe_push (agent_expr_p, bl->target_info.conditions,
- loc->cond_bytecode.get ());
+ {
+ /* Add the condition to the vector. This will be used later
+ to send the conditions to the target. */
+ bl->target_info.conditions.push_back (loc->cond_bytecode.get ());
+ }
}
return;
@@ -2481,8 +2482,8 @@ build_target_command_list (struct bp_location *bl)
int modified = bl->needs_update;
struct bp_location *loc;
- /* Release commands left over from a previous insert. */
- VEC_free (agent_expr_p, bl->target_info.tcommands);
+ /* Clear commands left over from a previous insert. */
+ bl->target_info.tcommands.clear ();
if (!target_can_run_breakpoint_commands ())
return;
@@ -2565,10 +2566,11 @@ build_target_command_list (struct bp_location *bl)
&& loc->pspace->num == bl->pspace->num
&& loc->owner->enable_state == bp_enabled
&& loc->enabled)
- /* Add the command to the vector. This will be used later
- to send the commands to the target. */
- VEC_safe_push (agent_expr_p, bl->target_info.tcommands,
- loc->cmd_bytecode.get ());
+ {
+ /* Add the command to the vector. This will be used later
+ to send the commands to the target. */
+ bl->target_info.tcommands.push_back (loc->cmd_bytecode.get ());
+ }
}
bl->target_info.persist = 0;
@@ -12888,9 +12890,6 @@ static void
bp_location_dtor (struct bp_location *self)
{
xfree (self->function_name);
-
- VEC_free (agent_expr_p, self->target_info.conditions);
- VEC_free (agent_expr_p, self->target_info.tcommands);
}
static const struct bp_location_ops bp_location_ops =