diff options
Diffstat (limited to 'gdb/gdbserver/gdbfreeplay-back.c')
-rw-r--r-- | gdb/gdbserver/gdbfreeplay-back.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/gdbserver/gdbfreeplay-back.c b/gdb/gdbserver/gdbfreeplay-back.c index bcfe49b..7d7cf41 100644 --- a/gdb/gdbserver/gdbfreeplay-back.c +++ b/gdb/gdbserver/gdbfreeplay-back.c @@ -326,11 +326,12 @@ frame_find_request (FILE *logfile, char *request) curpos = stopframe[cur_frame].eventpos; fseek (logfile, curpos, SEEK_SET); /* Now search for a matching request. */ - while (curpos < stopframe[cur_frame + 1].eventpos) + while ((line = fgets (inbuf, sizeof (inbuf), logfile)) != NULL) { - line = fgets (inbuf, sizeof (inbuf), logfile); - /* End of input? */ - if (line == NULL) + /* End of current frame? + If we're the last frame, just read till the end of file. */ + if (cur_frame < last_cached_frame && + curpos >= stopframe[cur_frame + 1].eventpos) break; curpos = ftell (logfile); if (strstr (line, request) != NULL) |