[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs doesn't show printf() output during debugging.

From: Nick Roberts
Subject: Re: Emacs doesn't show printf() output during debugging.
Date: Thu, 18 Aug 2005 09:29:57 +1200

> When I debug my C program, I can't see the printf() output in any buffer.
> However, I can provide input to scanf() in the GUD buffer. What should 
> I do to show the output? I am using Emacs (CVS) on Windows2000.

I don't debug on Windows but I have been told that this works:

;; If you are using Emacs and GDB on Windows you will need to flush the buffer
;; explicitly in your program if you want timely display of I/O in Emacs.
;; Alternatively you can make the output stream unbuffered, for example, by
;; using a macro:
;;           #ifdef UNBUFFERED
;;           setvbuf (stdout, (char *) NULL, _IONBF, 0);
;;           #endif
;; and compiling with -DUNBUFFERED while debugging.

I think that if the string to be printed is terminated with \n, this will
also display at the desired time (line buffering?).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]