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 18:47:20 +0100 Organization: Akustik Technologie Goettingen Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <15515.28200.228210.321561@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> <15515.15905.64808.177966@jupiter.akutech-local.de> <2110-Fri22Mar2002190057+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 1016819297 27659 127.0.0.1 (22 Mar 2002 17:48:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 22 Mar 2002 17:48:17 +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 16oT9F-0007C0-00 for ; Fri, 22 Mar 2002 18:48:17 +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 16oT9D-0006St-00; Fri, 22 Mar 2002 12:48:15 -0500 Original-Received: from mail.t-intra.de ([62.156.146.210]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16oT8N-0006RB-00 for ; Fri, 22 Mar 2002 12:47:23 -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 18:47:21 +0100 Original-Received: (from ralf@localhost) by jupiter.akutech-local.de (8.11.1/8.11.1) id g2MHlKh4457863; Fri, 22 Mar 2002 18:47:20 +0100 (MET) Original-To: Eli Zaretskii In-Reply-To: <2110-Fri22Mar2002190057+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:88 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:88 * Eli Zaretskii | This gets stranger and stranger... Indeed :-/ | How about disassembly of printchar? Does it show the call to fwrite | in both cases? You mean the assembler code output as of gcc -S ... print.c? Yes, it does show a call to fwrite, although in different syntax for gcc and cc (which doesn't surprise me). ------------------------------ gcc .L22: .LM36: lw $2,noninteractive beq $2,$0,.L25 .LM37: addu $2,$fp,24 move $4,$2 li $5,1 # 0x1 lw $6,32($fp) lw $7,.LC0 la $25,fwrite jal $31,$25 .LM38: li $2,1 # 0x1 sw $2,noninteractive_need_newline .LM39: ------------------------------ cc: .BB25.printchar: # 0x2c8 .loc 1 333 4 # 332 { # 333 fwrite (str, 1, len, stdout); addiu $4,$sp,0 # str addiu $5,$0,1 # lw $6,4($sp) # len lw $7,%got_disp(__iob)($gp) # __iob addiu $7,$7,16 # lw $25,%call16(fwrite)($gp) # fwrite jalr $25 # fwrite nop # .BB26.printchar: # 0x2e8 .loc 1 334 4 # 334 noninteractive_need_newline = 1; addiu $8,$0,1 # ------------------------- | What happens if you replace `fwrite' with `fflush' followed by | `write'? Does that change anything? Errr, yes, it does. If I apply the following diff: *** print.c~ Wed Aug 1 10:27:38 2001 --- print.c Fri Mar 22 18:35:49 2002 *************** *** 330,336 **** } else if (noninteractive) { ! fwrite (str, 1, len, stdout); noninteractive_need_newline = 1; } else --- 330,339 ---- } else if (noninteractive) { ! fflush(stdout); ! write (1, str, len); ! ! /* fwrite (str, 1, len, stdout); */ noninteractive_need_newline = 1; } else I get ./emacs -batch -no-site-file -l foo "21.2.1" I.e. it `works'. If I put at the start of main: write(1,"write\n",6); fwrite("frwite\n", 7,1,stdout); I see the `write', but not the fwrite when I compile with gcc. I see both when I compile with cc. | Another idea is to put a breakpoint inside fwrite, and see if it's | called at all. While gdb accepts the break command, it does not stop in fwrite in both cases (gcc and cc). However, cc-compiled prints, gcc-compiled does not. cc: (gdb) br fwrite Breakpoint 4 at 0xfa52f48: file engine.c, line 592. (gdb) c "21.2.1" Program exited normally. gcc: (gdb) br fwrite Breakpoint 4 at 0xfa52f48: file engine.c, line 592. (gdb) c Program exited normally. I don't know whether it makes much sense to dig deeper here. While I'm as curious what is the problem here, maybe I just go and fetch the CVS version and see what happens there. R' _______________________________________________ Bug-gnu-emacs mailing list Bug-gnu-emacs@gnu.org http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs