From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stu Grossman To: gdb-patches@cygnus.com Subject: Re: gdb-4.17 patch to fix filehandle-mode for DJGPP Date: Thu, 01 Apr 1999 00:00:00 -0000 Message-id: <13987.26926.288559.877952@babylon-5.cygnus.com> References: <003701be4261$47f12700$19a46d86@robby.dittmannsdorf.de> <003701be4261$47f12700$19a46d86@robby.dittmannsdorf.de> X-SW-Source: 1999-q1/msg00015.html Robert Hoehne writes: > On MSDOS, the debugger and the debuggee share file handles. > If the debuggee switches its stdin to binary mode, the same > happens to the debugger's stdin, and fgetc loses. We > need therefore to switch stdin to TEXT mode. When not longer > needed, the original mode of stdin is reset. The same situation exists for Unix, and GDB handles that correctly. There are several target vectore entries which are used to save and restore the console's state between GDB and the target program. Your fixes need to be applied there, not in GDB's generic console I/O code. See the following macros in target.h for details: /* Initialize the terminal settings we record for the inferior, before we actually run the inferior. */ #define target_terminal_init() \ (*current_target.to_terminal_init) () /* Put the inferior's terminal settings into effect. This is preparation for starting or resuming the inferior. */ #define target_terminal_inferior() \ (*current_target.to_terminal_inferior) () /* Put some of our terminal settings into effect, enough to get proper results from our output, but do not change into or out of RAW mode so that no input is discarded. After doing this, either terminal_ours or terminal_inferior should be called to get back to a normal state of affairs. */ #define target_terminal_ours_for_output() \ (*current_target.to_terminal_ours_for_output) () /* Put our terminal settings into effect. First record the inferior's terminal settings so they can be restored properly later. */ #define target_terminal_ours() \ (*current_target.to_terminal_ours) () /* Print useful information about our terminal status, if such a thing exists. */ #define target_terminal_info(arg, from_tty) \ (*current_target.to_terminal_info) (arg, from_tty) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stu Grossman To: gdb-patches@cygnus.com Subject: Re: gdb-4.17 patch to fix filehandle-mode for DJGPP Date: Mon, 18 Jan 1999 09:02:00 -0000 Message-ID: <13987.26926.288559.877952@babylon-5.cygnus.com> References: <003701be4261$47f12700$19a46d86@robby.dittmannsdorf.de> <003701be4261$47f12700$19a46d86@robby.dittmannsdorf.de> X-SW-Source: 1999-01/msg00015.html Message-ID: <19990118090200.12s4IoD7-TbviQIPUF-KvqQUsMhrEmZGW4H_zGNfTbY@z> Robert Hoehne writes: > On MSDOS, the debugger and the debuggee share file handles. > If the debuggee switches its stdin to binary mode, the same > happens to the debugger's stdin, and fgetc loses. We > need therefore to switch stdin to TEXT mode. When not longer > needed, the original mode of stdin is reset. The same situation exists for Unix, and GDB handles that correctly. There are several target vectore entries which are used to save and restore the console's state between GDB and the target program. Your fixes need to be applied there, not in GDB's generic console I/O code. See the following macros in target.h for details: /* Initialize the terminal settings we record for the inferior, before we actually run the inferior. */ #define target_terminal_init() \ (*current_target.to_terminal_init) () /* Put the inferior's terminal settings into effect. This is preparation for starting or resuming the inferior. */ #define target_terminal_inferior() \ (*current_target.to_terminal_inferior) () /* Put some of our terminal settings into effect, enough to get proper results from our output, but do not change into or out of RAW mode so that no input is discarded. After doing this, either terminal_ours or terminal_inferior should be called to get back to a normal state of affairs. */ #define target_terminal_ours_for_output() \ (*current_target.to_terminal_ours_for_output) () /* Put our terminal settings into effect. First record the inferior's terminal settings so they can be restored properly later. */ #define target_terminal_ours() \ (*current_target.to_terminal_ours) () /* Print useful information about our terminal status, if such a thing exists. */ #define target_terminal_info(arg, from_tty) \ (*current_target.to_terminal_info) (arg, from_tty)