help-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Rolex JM
Subject: Re: Emacs doesn't show printf() output during debugging.
Date: Fri, 19 Aug 2005 11:25:01 +0000

I have tried
      setvbuf (stdout, (char *) NULL, _IONBF, 0);
and
      fflush(stdout);
respectively. They both worked. Thanks lot.

From: Nick Roberts <nickrob@snap.net.nz>
To: Lao JM <rolexletter@hotmail.com>
CC: help-gnu-emacs@gnu.org
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 21.3.50.1 (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?).

Nick

_________________________________________________________________
免费下载 MSN Explorer: http://explorer.msn.com/lccn/




reply via email to

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