aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-11-09 12:49:43 +0000
committerPedro Alves <palves@redhat.com>2016-11-09 14:57:55 +0000
commit6c73cd95f96d37dbf6092a87c8ba0f35277223a5 (patch)
tree1df7a0ca6bc434f553e705850b9bbd1d08fc0532 /gdb/tracepoint.c
parent7a63494a0df60cf71b9cf03c4eb8f24719d03e66 (diff)
downloadgdb-6c73cd95f96d37dbf6092a87c8ba0f35277223a5.zip
gdb-6c73cd95f96d37dbf6092a87c8ba0f35277223a5.tar.gz
gdb-6c73cd95f96d37dbf6092a87c8ba0f35277223a5.tar.bz2
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.
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 2a40b16..0cb12c7 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1076,7 +1076,7 @@ collection_list::collect_symbol (struct symbol *sym,
}
}
- add_aexpr (gdb::move (aexpr));
+ add_aexpr (std::move (aexpr));
}
}
@@ -1180,12 +1180,6 @@ collection_list::collection_list ()
m_aexprs.reserve (128);
}
-collection_list::~collection_list ()
-{
- for (int ndx = 0; ndx < m_aexprs.size (); ndx++)
- delete m_aexprs[ndx];
-}
-
/* Reduce a collection list to string form (for gdb protocol). */
char **
@@ -1419,7 +1413,7 @@ encode_actions_1 (struct command_line *action,
}
}
- collect->add_aexpr (gdb::move (aexpr));
+ collect->add_aexpr (std::move (aexpr));
action_exp = strchr (action_exp, ','); /* more? */
}
else if (0 == strncasecmp ("$_sdata", action_exp, 7))
@@ -1508,7 +1502,7 @@ encode_actions_1 (struct command_line *action,
}
}
- collect->add_aexpr (gdb::move (aexpr));
+ collect->add_aexpr (std::move (aexpr));
collect->append_exp (exp.get ());
break;
} /* switch */
@@ -1538,7 +1532,7 @@ encode_actions_1 (struct command_line *action,
/* Even though we're not officially collecting, add
to the collect list anyway. */
- collect->add_aexpr (gdb::move (aexpr));
+ collect->add_aexpr (std::move (aexpr));
} /* do */
}
while (action_exp && *action_exp++ == ',');
@@ -1602,7 +1596,7 @@ encode_actions_rsp (struct bp_location *tloc, char ***tdp_actions,
void
collection_list::add_aexpr (agent_expr_up aexpr)
{
- m_aexprs.push_back (aexpr.release ());
+ m_aexprs.push_back (std::move (aexpr));
}
static void