GNU Binutils with patches for OS216
Revision | 9a943f6ec34b032f95a14a0ac8f1d8304933885e (tree) |
---|---|
Time | 2008-06-23 05:42:49 |
Author | Michael Snyder <msnyder@vmwa...> |
Commiter | Michael Snyder |
2008-06-21 Michael Snyder <msnyder@specifix.com>
Fix stepping/breakpoint off-by-one issues.
* gdbfreeplay-back.c (freeplay_find_event): Fix off-by-one error
on last_cached_frame.
(freeplay_show_next_commands): Ditto.
(handle_special_case): Ditto, plus don't pass breakpoint_p == TRUE
to target_compose_T_packet if we're stopped at the end of the
event cache.
@@ -1,5 +1,13 @@ | ||
1 | 1 | 2008-06-21 Michael Snyder <msnyder@specifix.com> |
2 | 2 | |
3 | + Fix stepping/breakpoint off-by-one issues. | |
4 | + * gdbfreeplay-back.c (freeplay_find_event): Fix off-by-one error | |
5 | + on last_cached_frame. | |
6 | + (freeplay_show_next_commands): Ditto. | |
7 | + (handle_special_case): Ditto, plus don't pass breakpoint_p == TRUE | |
8 | + to target_compose_T_packet if we're stopped at the end of the | |
9 | + event cache. | |
10 | + | |
3 | 11 | * gdbfreeplay-back.c (handle_special_case): Silence gcc warning. |
4 | 12 | * gdbfreeplay-i386.c (target_compose_g_packet): Ditto. |
5 | 13 |
@@ -573,7 +573,7 @@ freeplay_find_event (FILE *infile, | ||
573 | 573 | |
574 | 574 | /* Here's a strange loop for you: goes forward or backward. */ |
575 | 575 | for (i = start; |
576 | - i >= 0 && i < last_cached_frame; | |
576 | + i >= 0 && i <= last_cached_frame; | |
577 | 577 | direction == DIR_FORWARD ? i++ : i--) |
578 | 578 | { |
579 | 579 | signum = stopframe_signal (infile, i); |
@@ -648,12 +648,12 @@ freeplay_show_next_commands (FILE *infile) | ||
648 | 648 | { |
649 | 649 | char *line; |
650 | 650 | |
651 | - if (cur_frame >= 0 && cur_frame < last_cached_frame) | |
651 | + if (cur_frame >= 0 && cur_frame <= last_cached_frame) | |
652 | 652 | { |
653 | 653 | fseek (infile, stopframe[cur_frame].eventpos, SEEK_SET); |
654 | 654 | while ((line = fgets (inbuf, sizeof (inbuf), infile)) != NULL) |
655 | 655 | { |
656 | - if (cur_frame + 1 < last_cached_frame && | |
656 | + if (cur_frame + 1 <= last_cached_frame && | |
657 | 657 | ftell (infile) >= stopframe[cur_frame + 1].eventpos) |
658 | 658 | /* Done with current frame. */ |
659 | 659 | break; |
@@ -800,7 +800,7 @@ handle_special_case (FILE *infile, int fd, char *request) | ||
800 | 800 | } |
801 | 801 | else |
802 | 802 | { |
803 | - cur_frame = last_cached_frame - 1; | |
803 | + cur_frame = last_cached_frame; | |
804 | 804 | } |
805 | 805 | |
806 | 806 | /* Find the original event message for this stop event. */ |
@@ -811,6 +811,8 @@ handle_special_case (FILE *infile, int fd, char *request) | ||
811 | 811 | if ((p = strstr (inbuf, "$T")) != NULL) |
812 | 812 | return add_checksum (target_compose_T_packet (p, |
813 | 813 | stopframe[cur_frame].pc, |
814 | + next_event_frame == -1 ? | |
815 | + 0 : | |
814 | 816 | 1 /* breakpoint_p */)); |
815 | 817 | /* If it's a "$S", just return it (FIXME?) */ |
816 | 818 | else |
@@ -849,6 +851,8 @@ handle_special_case (FILE *infile, int fd, char *request) | ||
849 | 851 | if ((p = strstr (inbuf, "$T")) != NULL) |
850 | 852 | return add_checksum (target_compose_T_packet (p, |
851 | 853 | stopframe[cur_frame].pc, |
854 | + next_event_frame == -1 ? | |
855 | + 0 : | |
852 | 856 | 1 /* breakpoint_p */)); |
853 | 857 | /* If it's a "$S", just return it (FIXME?) */ |
854 | 858 | else |