From 1fe7f64c13e8994b73a5da3f5582de5b4850bfa2 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 10 Jun 2013 21:24:15 +0300 Subject: Bug fix for debugger under Windows. --- debug.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'debug.c') diff --git a/debug.c b/debug.c index d60164aa..6d3936b1 100644 --- a/debug.c +++ b/debug.c @@ -519,6 +519,9 @@ print_lines(char *src, int start_line, int nlines) return -1; } + /* set binary mode so that byte offset calculations will be right */ + os_setbinmode(s->fd, O_BINARY); + if (fstat(s->fd, &sbuf) == 0 && s->mtime < sbuf.st_mtime) { fprintf(out_fp, _("WARNING: source file `%s' modified since program compilation.\n"), src); @@ -534,6 +537,7 @@ print_lines(char *src, int start_line, int nlines) src, strerror(errno)); return -1; } + os_setbinmode(s->fd, O_BINARY); } if (s->line_offset == NULL && find_lines(s) != 0) -- cgit v1.2.3