This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH obv] Use range-based for loop in remote_add_target_side_commands
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>
- Date: Fri, 3 Mar 2017 13:06:29 -0500
- Subject: [PATCH obv] Use range-based for loop in remote_add_target_side_commands
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=ericsson.com;
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
FYI, I just pushed this as obvious.
gdb/ChangeLog:
* remote.c (remote_add_target_side_commands): Use range-based
for loop.
---
gdb/ChangeLog | 5 +++++
gdb/remote.c | 4 +---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 368b24c93e..ccca5bfbe3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2017-03-03 Simon Marchi <simon.marchi@ericsson.com>
+
+ * remote.c (remote_add_target_side_commands): Use range-based
+ for loop.
+
2017-03-03 Yao Qi <yao.qi@linaro.org>
PR gdb/21165
diff --git a/gdb/remote.c b/gdb/remote.c
index 5da8319823..2f34c4c300 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -9690,10 +9690,8 @@ remote_add_target_side_commands (struct gdbarch *gdbarch,
/* Concatenate all the agent expressions that are commands into the
cmds parameter. */
- for (int ix = 0; ix < bp_tgt->tcommands.size (); ix++)
+ for (agent_expr *aexpr : bp_tgt->tcommands)
{
- struct agent_expr *aexpr = bp_tgt->tcommands[ix];
-
sprintf (buf, "X%x,", aexpr->len);
buf += strlen (buf);
for (int i = 0; i < aexpr->len; ++i)
--
2.11.0