Mail Archives: djgpp/1995/06/07/14:46:39
There is a small problem in the BFD library when compiling for DJGPP
(gdb-4.12 and gdb-4.13).
In bfd_fdopenr function (opncls.c) there is the following code :
#if defined(VMS) || defined(__GO32__)
nbfd->iostream = (char *)fopen(filename, FOPEN_RB);
#else
/* (O_ACCMODE) parens are to avoid Ultrix header file bug */
switch (fdflags & (O_ACCMODE)) {
case O_RDONLY: nbfd->iostream = (char *) fdopen (fd, FOPEN_RB); break;
case O_WRONLY: nbfd->iostream = (char *) fdopen (fd, FOPEN_RUB); break;
case O_RDWR: nbfd->iostream = (char *) fdopen (fd, FOPEN_RUB); break;
default: abort ();
}
#endif
The problem with this code is that , when __GO32__ is defined, 'fd' is not
used at all, and thus bfd_close will NOT close this 'fd' ! This is a
problem when doing several 'exec-file' commands in a gdb session.
One possible fix would be to use DJGPP's fdopen. Does anybody knows why
fdopen is not used here for DJGPP ?
Regards
Pierre Willard
- Raw text -