Subject: Re: Problems with gdb under NetBSD 1.0
To: Keith D. Browne <tuxedo@io.org>
From: John F. Woods <jfw@jfwhome.funhouse.com>
List: current-users
Date: 12/08/1994 08:00:11
> I read your recent message in current-users about gdb having
> difficulty working with halted programs.
> I've been having similar trouble since I upgraded to NetBSD 1.0 (i386)
> a couple of weeks ago. ...
> I'd really appreciate it if you could send me the diffs you mentioned
> for fixing the lseek calls in gdb.

Since the same problem still appears in the current source, here are the
changes I made to get gdb to work at all for me.  Someone with more
familiarity with gdb should look these over and see if they're really
sufficient.

*** source.c	Thu Dec  8 07:56:03 1994
--- /usr/src/gnu/usr.bin/gdb/gdb/source.c	Tue Dec  6 21:56:27 1994
***************
*** 858,864 ****
  	     line, s->filename, s->nlines);
      }
  
!   if (lseek (desc, s->line_charpos[line - 1], 0) < 0)
      {
        close (desc);
        perror_with_name (s->filename);
--- 858,864 ----
  	     line, s->filename, s->nlines);
      }
  
!   if (lseek (desc, (off_t)s->line_charpos[line - 1], 0) < 0)
      {
        close (desc);
        perror_with_name (s->filename);
***************
*** 1210,1216 ****
        error ("Expression not found");
      }
  
!   if (lseek (desc, current_source_symtab->line_charpos[line - 1], 0) < 0)
      {
        close (desc);
        perror_with_name (current_source_symtab->filename);
--- 1210,1216 ----
        error ("Expression not found");
      }
  
!   if (lseek (desc, (off_t)current_source_symtab->line_charpos[line - 1], 0) < 0)
      {
        close (desc);
        perror_with_name (current_source_symtab->filename);
***************
*** 1282,1288 ****
        error ("Expression not found");
      }
  
!   if (lseek (desc, current_source_symtab->line_charpos[line - 1], 0) < 0)
      {
        close (desc);
        perror_with_name (current_source_symtab->filename);
--- 1282,1288 ----
        error ("Expression not found");
      }
  
!   if (lseek (desc, (off_t)current_source_symtab->line_charpos[line - 1], 0) < 0)
      {
        close (desc);
        perror_with_name (current_source_symtab->filename);