Date: Mon, 18 Nov 1996 18:32:38 +0200 (IST) From: Eli Zaretskii To: djgpp-workers AT delorie DOT com Subject: Minor fixes for dbgcom.c Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII src/debug/common/dbgcom.c patched with Robert's changes would not compile due to unused variables (library make uses restricted gcc options which treat warnings as errors). I removed the unused variables, and also corrected some typos and wording problems in the comments. *** src/debug/common/dbgcom.c~1 Mon Nov 18 18:13:32 1996 --- src/debug/common/dbgcom.c Mon Nov 18 18:23:46 1996 *************** void cleanup_client(void) *** 670,687 **** } /* ! Now the FSEXT function to watching the opened files. This is needed, because the debuggee can open files which are not closed and if you do this multiple times, the limit of max opened files is reached. ! The watching is done by the FSEXT function by hooking the ! _open(), _creat() and _close() calls from the libc functions. The ! only things which are added is in remembering of the files, which ! are opened (and closed) by debugger. When cleanup_client() is called ! this list is compared with actual opened files and every file, which ! was not watched dbg_fsext() is closed. ! This technique does not work correct when the debugger uses the lowest routines for opening/creating/closing files which are _dos_open(), _dos_creat(), _dos_creatnew() and _dos_close(). */ --- 670,687 ---- } /* ! Now the FSEXT function for watching files being opened. This is needed, because the debuggee can open files which are not closed and if you do this multiple times, the limit of max opened files is reached. ! The watching is done by the FSEXT function by hooking the _open(), ! _creat() and _close() calls from the libc functions. The only things ! which are added is recording files which are opened (and closed) by ! the debugger. When cleanup_client() is called, this list is compared ! with actual open files and every file, which was not seen by dbg_fsext() ! is closed. ! This technique does not work correctly when the debugger uses the lowest routines for opening/creating/closing files which are _dos_open(), _dos_creat(), _dos_creatnew() and _dos_close(). */ *************** static void close_handles(void) *** 717,723 **** if (_farpeekb(_dos_ds,jft_ofs++) != 0xff /* it is an opened handle */ && handles[handle] == 0xff /* but not recorded by the fsext function */ ) ! { /* it was opened by the debugge */ #ifdef DEBUG_DBGCOM fprintf(stderr,"closing %d\n",handle); #endif --- 717,723 ---- if (_farpeekb(_dos_ds,jft_ofs++) != 0xff /* it is an opened handle */ && handles[handle] == 0xff /* but not recorded by the fsext function */ ) ! { /* it was opened by the debuggee */ #ifdef DEBUG_DBGCOM fprintf(stderr,"closing %d\n",handle); #endif *************** static int dbg_fsext(__FSEXT_Fnumber _fu *** 790,802 **** return 1; } ! /* With attribute constructor to be called automaticaly befor main */ static void __attribute__((__constructor__)) _init_dbg_fsext(void) { __dpmi_regs r; - int i, fd; int psp_la; int jft_ofs; int jft_count; --- 790,801 ---- return 1; } ! /* With attribute constructor to be called automaticaly before main */ static void __attribute__((__constructor__)) _init_dbg_fsext(void) { __dpmi_regs r; int psp_la; int jft_ofs; int jft_count;