Message-ID: <36587012.6CD59200@synopsys.com> Date: Sun, 22 Nov 1998 12:12:02 -0800 From: Ron Miller X-Mailer: Mozilla 4.04 [en] (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp To: djgpp AT delorie DOT com Subject: Re: Help with GDB ... gdb always exits and stdout goes missing References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Hi, Thanks for the quick response. The information that you requested is found below. Ron Miller rmiller AT synopsys DOT com Eli Zaretskii wrote: > On Sat, 21 Nov 1998, Ron Miller wrote: > > > 1) If I set a breakpoint and then continue, the debugger exits when I > > continue. For example, here is the output of running a "hello world" > > program ... > [snip] > > Note that when I stepped into the program and then continued, the > > debugger exited when the program being debugged finished. > > > > 2) Also ... when stepping through a program, stdout doesn't seem to be > > displayed. If you notice in the above output, "hello world" was > > displayed when I ran the program with no breakpoints, but was nowhere to > > be seen when I stopped in main and then continued. > > I have never seen these problems. Please post more details about the > program and your setup: > > 1) The type and version of your operating system (DOS? > Windows? what version?). I am running Windows NT 4.0 (I would assume the latest and greates rev as I have a new system from Dell that is only a month old). I tried running GDB both under the system MSDOS prompt (from the start menu ... WINT/System32/cmd.exe). I am not sure which version of MSDos this is ... running cmd /v returned: Microsoft(R) Windows NT(TM) (C) Copyright 1985-1996 Microsoft Corp. I also tried running gdb from a MKS Toolkit Korn Shell with the same results. > > > 2) The size and time stamp of gdb.exe you are using, and what > was the name of the zip file you got it from. The version of gdb that I am using is: GDB 4.16 (go32), Copyright 1996 Free Software Foundation, Inc. The timestamp is: -rwxrwxrwa 1 Administrators RMILLER-LAP\None 814592 Oct 19 1996 gdb.exe It was retrieved from the following zip file: ftp://ftp.digital.com/pub/micro/pc/simtelnet/gnu/djgpp/v2gnu/gdb416b.zip > > > 3) The source of the program you were debugging, the GCC > command used to compile and link it, and the GDB command > line used to invoke the debugger. The source code is not that complicated ... main() { printf( "Hello world\n" ); } Here is an example run of compiling and then debugging: % gcc -g test.c % gdb a.out GDB is free software and you are welcome to distribute copies of it under certain conditions; type "show copying" to see the conditions. There is absolutely no warranty for GDB; type "show warranty" for details. GDB 4.16 (go32), Copyright 1996 Free Software Foundation, Inc... (gdb) run Starting program: .../a.out Hello world Program exited normally. (gdb) break main Breakpoint 1 at 0x158b: file test.c, line 2. (gdb) run Starting program: .../a.out Breakpoint 1, main () at test.c:2 2 printf( "Hello world\n" ); (gdb) c % > > > 4) The version of GCC you used to compile and link your > program. The timestamp of my gcc is: -rwxrwxrwa 1 Administrators RMILLER-LAP\None 130560 Oct 22 16:31 gcc.exe And the version is: % gcc -v Reading specs from d:/dent/djgpp/lib/specs gcc version 2.8.1 This was retrieved from the zip file: ftp://ftp.digital.com/pub/micro/pc/simtelnet/gnu/djgpp/v2gnu/gcc281b.zip > > > FYI, the deviation of the GDB operation on DOS/Windows from what it > does on Unix are spelled out in section 12.1 of the DJGPP FAQ list. > None of what you report comes close to what's described there.