• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revision9a943f6ec34b032f95a14a0ac8f1d8304933885e (tree)
Time2008-06-23 05:42:49
AuthorMichael Snyder <msnyder@vmwa...>
CommiterMichael Snyder

Log Message

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.

Change Summary

Incremental Difference

--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,13 @@
11 2008-06-21 Michael Snyder <msnyder@specifix.com>
22
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+
311 * gdbfreeplay-back.c (handle_special_case): Silence gcc warning.
412 * gdbfreeplay-i386.c (target_compose_g_packet): Ditto.
513
--- a/gdb/gdbserver/gdbfreeplay-back.c
+++ b/gdb/gdbserver/gdbfreeplay-back.c
@@ -573,7 +573,7 @@ freeplay_find_event (FILE *infile,
573573
574574 /* Here's a strange loop for you: goes forward or backward. */
575575 for (i = start;
576- i >= 0 && i < last_cached_frame;
576+ i >= 0 && i <= last_cached_frame;
577577 direction == DIR_FORWARD ? i++ : i--)
578578 {
579579 signum = stopframe_signal (infile, i);
@@ -648,12 +648,12 @@ freeplay_show_next_commands (FILE *infile)
648648 {
649649 char *line;
650650
651- if (cur_frame >= 0 && cur_frame < last_cached_frame)
651+ if (cur_frame >= 0 && cur_frame <= last_cached_frame)
652652 {
653653 fseek (infile, stopframe[cur_frame].eventpos, SEEK_SET);
654654 while ((line = fgets (inbuf, sizeof (inbuf), infile)) != NULL)
655655 {
656- if (cur_frame + 1 < last_cached_frame &&
656+ if (cur_frame + 1 <= last_cached_frame &&
657657 ftell (infile) >= stopframe[cur_frame + 1].eventpos)
658658 /* Done with current frame. */
659659 break;
@@ -800,7 +800,7 @@ handle_special_case (FILE *infile, int fd, char *request)
800800 }
801801 else
802802 {
803- cur_frame = last_cached_frame - 1;
803+ cur_frame = last_cached_frame;
804804 }
805805
806806 /* Find the original event message for this stop event. */
@@ -811,6 +811,8 @@ handle_special_case (FILE *infile, int fd, char *request)
811811 if ((p = strstr (inbuf, "$T")) != NULL)
812812 return add_checksum (target_compose_T_packet (p,
813813 stopframe[cur_frame].pc,
814+ next_event_frame == -1 ?
815+ 0 :
814816 1 /* breakpoint_p */));
815817 /* If it's a "$S", just return it (FIXME?) */
816818 else
@@ -849,6 +851,8 @@ handle_special_case (FILE *infile, int fd, char *request)
849851 if ((p = strstr (inbuf, "$T")) != NULL)
850852 return add_checksum (target_compose_T_packet (p,
851853 stopframe[cur_frame].pc,
854+ next_event_frame == -1 ?
855+ 0 :
852856 1 /* breakpoint_p */));
853857 /* If it's a "$S", just return it (FIXME?) */
854858 else