agent_expr_up: gdb::unique_ptr -> std::unique_ptr

Now that we require C++11, use std::unique_ptr directly.  This allows
simplifying collection_list a bit by placing unique pointers in the
vector directly, making the vector own its elements.

gdb/ChangeLog:
2016-11-09  Pedro Alves  <palves@redhat.com>

	* ax-gdb.c (agent_eval_command_one): Use std::move instead of
	gdb::move.
	* ax.h (agent_expr_up): Use std::unique_ptr instead of
	gdb::unique_ptr.
	* breakpoint.c (parse_cond_to_aexpr): Use std::move instead of
	gdb::move.
	* tracepoint.c (collection_list::collect_symbol): Likewise.
	(collection_list::~collection_list): Delete.
	(encode_actions_1): Use std::move instead of gdb::move.
	(collection_list::add_aexpr): Use std::move instead of
	unique_ptr::release.
	* tracepoint.h (collection_list) <~collection_list>: Delete
	declaration.
	<m_aexprs>: Now a vector of agent_ptr_up.
This commit is contained in:
Pedro Alves
2016-11-09 12:49:43 +00:00
parent 7a63494a0d
commit 6c73cd95f9
6 changed files with 29 additions and 20 deletions

View File

@@ -2555,7 +2555,7 @@ agent_eval_command_one (const char *exp, int eval, CORE_ADDR pc)
arg = exp;
if (!eval && strcmp (arg, "$_ret") == 0)
{
agent = gdb::move (gen_trace_for_return_address (pc, get_current_arch (),
agent = std::move (gen_trace_for_return_address (pc, get_current_arch (),
trace_string));
}
else
@@ -2565,10 +2565,10 @@ agent_eval_command_one (const char *exp, int eval, CORE_ADDR pc)
if (eval)
{
gdb_assert (trace_string == 0);
agent = gdb::move (gen_eval_for_expr (pc, expr.get ()));
agent = std::move (gen_eval_for_expr (pc, expr.get ()));
}
else
agent = gdb::move (gen_trace_for_expr (pc, expr.get (), trace_string));
agent = std::move (gen_trace_for_expr (pc, expr.get (), trace_string));
}
ax_reqs (agent.get ());