aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2013-03-07 13:17:28 +0000
committerYao Qi <yao@codesourcery.com>2013-03-07 13:17:28 +0000
commite64f749990145b448f6bac4eac24748b476430e4 (patch)
tree1ec86f5c3dfe0a6c92cf261e5f1ad11eba192916 /gdb/gdbserver
parent77dec115afceba0cc5eb3e925ad1bf1e1ecd8bf5 (diff)
downloadgdb-e64f749990145b448f6bac4eac24748b476430e4.zip
gdb-e64f749990145b448f6bac4eac24748b476430e4.tar.gz
gdb-e64f749990145b448f6bac4eac24748b476430e4.tar.bz2
gdb/gdbserver/
* tracepoint.c (cur_action, cur_step_action): Make them unsigned. (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead of -1. (cmd_qtsp): Adjust condition. Do post increment. Set cur_action and cur_step_action back to 0.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog8
-rw-r--r--gdb/gdbserver/tracepoint.c16
2 files changed, 16 insertions, 8 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 67bc149..5e92b7b 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,11 @@
+2013-03-07 Yao Qi <yao@codesourcery.com>
+
+ * tracepoint.c (cur_action, cur_step_action): Make them unsigned.
+ (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead
+ of -1.
+ (cmd_qtsp): Adjust condition. Do post increment.
+ Set cur_action and cur_step_action back to 0.
+
2013-03-07 Jeremy Bennett <jeremy.bennett@embecosm.com>
PR server/15236
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 0f83ae6..632ee14 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -3684,8 +3684,8 @@ cmd_qtp (char *own_buf)
/* State variables to help return all the tracepoint bits. */
static struct tracepoint *cur_tpoint;
-static int cur_action;
-static int cur_step_action;
+static unsigned int cur_action;
+static unsigned int cur_step_action;
static struct source_string *cur_source_string;
static struct trace_state_variable *cur_tsv;
@@ -3759,7 +3759,7 @@ cmd_qtfp (char *packet)
trace_debug ("Returning first tracepoint definition piece");
cur_tpoint = tracepoints;
- cur_action = cur_step_action = -1;
+ cur_action = cur_step_action = 0;
cur_source_string = NULL;
if (cur_tpoint)
@@ -3784,17 +3784,17 @@ cmd_qtsp (char *packet)
GDB misbehavior. */
strcpy (packet, "l");
}
- else if (cur_action < cur_tpoint->numactions - 1)
+ else if (cur_action < cur_tpoint->numactions)
{
- ++cur_action;
response_action (packet, cur_tpoint,
cur_tpoint->actions_str[cur_action], 0);
+ ++cur_action;
}
- else if (cur_step_action < cur_tpoint->num_step_actions - 1)
+ else if (cur_step_action < cur_tpoint->num_step_actions)
{
- ++cur_step_action;
response_action (packet, cur_tpoint,
cur_tpoint->step_actions_str[cur_step_action], 1);
+ ++cur_step_action;
}
else if ((cur_source_string
? cur_source_string->next
@@ -3809,7 +3809,7 @@ cmd_qtsp (char *packet)
else
{
cur_tpoint = cur_tpoint->next;
- cur_action = cur_step_action = -1;
+ cur_action = cur_step_action = 0;
cur_source_string = NULL;
if (cur_tpoint)
response_tracepoint (packet, cur_tpoint);