From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ralf Fassel Newsgroups: gmane.emacs.bugs Subject: Re: `print' does not print Date: Fri, 22 Mar 2002 15:22:25 +0100 Organization: Akustik Technologie Goettingen Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <15515.15905.64808.177966@jupiter.akutech-local.de> References: <200203202019.g2KKJfs4410490@jupiter.akutech-local.de> <2593-Fri22Mar2002121734+0200-eliz@is.elta.co.il> <15515.2661.133668.691007@jupiter.akutech-local.de> <3791-Fri22Mar2002135807+0200-eliz@is.elta.co.il> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1016807051 14963 127.0.0.1 (22 Mar 2002 14:24:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 22 Mar 2002 14:24:11 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16oPxj-0003tD-00 for ; Fri, 22 Mar 2002 15:24:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16oPxi-0005dE-00; Fri, 22 Mar 2002 09:24:10 -0500 Original-Received: from mail.t-intra.de ([62.156.146.210]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16oPw7-0005SR-00 for ; Fri, 22 Mar 2002 09:22:31 -0500 Original-Received: from jupiter.akutech-local.de ([217.84.235.236]) by mail.t-intra.de with Microsoft SMTPSVC(5.5.1877.507.50); Fri, 22 Mar 2002 15:22:26 +0100 Original-Received: (from ralf@localhost) by jupiter.akutech-local.de (8.11.1/8.11.1) id g2MEMPP3462736; Fri, 22 Mar 2002 15:22:25 +0100 (MET) Original-To: Eli Zaretskii In-Reply-To: <3791-Fri22Mar2002135807+0200-eliz@is.elta.co.il> Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:80 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:80 * Eli Zaretskii | To do that, you could either (a) use some utility, such as truss or | strace, to report system calls issued by Emacs; This is `par' on IRIX, which shows close(4) and close(5), but no (!) write: ... 579mS : open("/disk4/tmp/ralf/Software/emacs-21.2/foo", O_RDONLY, 0) = 5 579mS : close(5) OK 580mS : open("/disk4/tmp/ralf/Software/emacs-21.2/foo", O_RDONLY, 0) = 5 580mS : close(5) OK 582mS : open("/disk4/tmp/ralf/Software/emacs-21.2/foo", O_RDONLY, 0) = 5 582mS : close(5) OK finish If I compile print.c alone with cc, and all the rest with gcc, I see ... 575mS : open("/disk4/tmp/ralf/Software/emacs-21.2/foo", O_RDONLY, 0) = 5 575mS : close(5) OK 576mS : open("/disk4/tmp/ralf/Software/emacs-21.2/foo", O_RDONLY, 0) = 5 576mS : close(5) OK 578mS : open("/disk4/tmp/ralf/Software/emacs-21.2/foo", O_RDONLY, 0) = 5 581mS : close(5) OK 587mS : write(1, "\n", 1) = 1 603mS : write(1, ""21.2.3"\n", 9) = 9 finish The CPP-preprocessed print.c shows the `fwrite' call in both cases, and the code is the same (apart from whitespace diff) after preprocessing. | or (b) invoke fwrite from GDB at the beginning of the Emacs `main' | function (put a breakpoint in `main' to stop Emacs there), and see | what it returns. % gdb ./emacs ... (gdb) br main Breakpoint 3 at 0x10162410: file emacs.c, line 708. (gdb) br print.c:333 Breakpoint 4 at 0x1024c220: file print.c, line 333. (gdb) run -batch -no-site-file -l ../foo Breakpoint 3, main (argc=0, argv=0x0, envp=0x0) at emacs.c:708 708 { (gdb) call printf("hello\n") hello $1 = 6 (gdb) call fwrite("hello\n",6,1,(&__iob[1])) hello $2 = 1 (gdb) c Both of these seem to work when called via gdb. Breakpoint 4, printchar (ch=10, fun=273132596) at print.c:333 333 fwrite (str, 1, len, stdout); (gdb) call fwrite (str, 1, len,(&__iob[1]) ) $3 = 1 Seems to have worked, newline is printed. (gdb) p str $4 = "\n\000\000" (gdb) n 334 noninteractive_need_newline = 1; Nothing is printed in this step. (gdb) c Breakpoint 4, printchar (ch=34, fun=273132596) at print.c:333 333 fwrite (str, 1, len, stdout); (gdb) p str $5 = "\"\000\002\"" (gdb) call fwrite (str, 1, len,(&__iob[1]) ) $6 = 1 Nothing is printed yet due to line buffering on stdout, see below. (gdb) n 334 noninteractive_need_newline = 1; (gdb) disable 4 (gdb) c " This is the quote from further abvove, fflushed on exit, but nothing else is printed. Program exited normally. (gdb) So the calls via gdb seem to work, while the calls from emacs itself don't. I do not understand this at all. R' _______________________________________________ Bug-gnu-emacs mailing list Bug-gnu-emacs@gnu.org http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs