From: Simon Marchi Date: Fri, 3 Mar 2017 17:58:24 +0000 (-0500) Subject: Use range-based for loop in remote_add_target_side_commands X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=df97be551faa262732128493c8ac159ae4b7f6d3;p=binutils-gdb.git Use range-based for loop in remote_add_target_side_commands gdb/ChangeLog: * remote.c (remote_add_target_side_commands): Use range-based for loop. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 368b24c93ef..ccca5bfbe36 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-03-03 Simon Marchi + + * remote.c (remote_add_target_side_commands): Use range-based + for loop. + 2017-03-03 Yao Qi PR gdb/21165 diff --git a/gdb/remote.c b/gdb/remote.c index 5da83198234..2f34c4c300f 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)