aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-02-27 13:54:53 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2017-02-27 13:54:53 -0500
commit8362122330c97c8c4a15da4e7ba8aa29f0c11157 (patch)
tree26a86c14a7b994526c1dbadaba07bb6674c06c4d /gdb/remote.c
parent2123df0ebfc7ade46784ef412226490d59f8ce05 (diff)
downloadgdb-8362122330c97c8c4a15da4e7ba8aa29f0c11157.zip
gdb-8362122330c97c8c4a15da4e7ba8aa29f0c11157.tar.gz
gdb-8362122330c97c8c4a15da4e7ba8aa29f0c11157.tar.bz2
Use range-based for loop in remote_add_target_side_condition
Using a range based for loop makes this code a bit more clean and readable. The comment above is clearly erroneous, so I've updated it. gdb/ChangeLog: * remote.c (remote_add_target_side_condition): Use range-based for loop. Update comment.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 87fb6e0..aedbd08 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -9664,11 +9664,9 @@ remote_add_target_side_condition (struct gdbarch *gdbarch,
xsnprintf (buf, buf_end - buf, "%s", ";");
buf++;
- /* Send conditions to the target and free the vector. */
- for (int ix = 0; ix < bp_tgt->conditions.size (); ix++)
+ /* Send conditions to the target. */
+ for (struct agent_expr *aexpr : bp_tgt->conditions)
{
- struct agent_expr *aexpr = bp_tgt->conditions[ix];
-
xsnprintf (buf, buf_end - buf, "X%x,", aexpr->len);
buf += strlen (buf);
for (int i = 0; i < aexpr->len; ++i)