--- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -1296,6 +1296,16 @@ do_map_commands_command (struct breakpoi { struct commands_info *info = data; + if (b->type == bp_tracepoint) + { + struct tracepoint *t = (struct tracepoint *) b; + + /* Reset the step count to 0 because if this tracepoint has step + action in before, it will not reset it to 0 if new actions + doesn't have while-stepping. */ + t->step_count = 0; + } + if (info->cmd == NULL) { struct command_line *l; --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -666,6 +666,11 @@ trace_actions_command (char *args, int f t->base.number); struct cleanup *cleanups = make_cleanup (xfree, tmpbuf); + /* Reset the step count to 0 because if this tracepoint has step + action in before, it will not reset it to 0 if new actions + doesn't have while-stepping. */ + t->step_count = 0; + l = read_command_lines (tmpbuf, from_tty, 1, check_tracepoint_command, t); do_cleanups (cleanups);