Nick Roberts wrote:
  
I found something useful.  If you do the command "set new-console off" 
at the gdb prompt, it does not open an new dos window, and everything 
works properly.  It only works if you do NOT put a -fullname switch on 
the gdb command line.  I suppose the right solution would be to have 
gdba automatically execute set new-console off when it starts up (I 
don;t think there's a command line switch for it.)
    

I've looked at this and it seems to work for the simple program that you gave. If, however, you set a breakpoint in your for loop or you add a read
statement then there are buffering problems that I can only solve by using
fflush in my program. Is it possible for GDB or Emacs to flush the inferior?

Nick

I get the same behavior - the flushing doesn't occur until the next time I read in the loop.