[Top][All Lists]

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

Re: `print' does not print

From: Ralf Fassel
Subject: Re: `print' does not print
Date: Sat, 23 Mar 2002 18:10:55 +0100

* Eli Zaretskii
| 9 is EBADF, AFAIK, so it might mean that the file handle is invalid.

Yup, that's correct, errno 9 is EBADF.

| But OTOH, you said that invoking fwrite from GDB works correctly, so
| I'm confused.

    Breakpoint 3, printchar (ch=10, fun=273515572) at print.c:333
    333           fwrite (str, 1, len, stdout);
    (gdb) p str
    $8 = "\n\000\000"
    (gdb) next
1   334           noninteractive_need_newline = 1;
    (gdb) call fwrite (str, 1, len, (&__iob[1]))
    $9 = 1

At `1' I would have expected to see the newline printed as a result
from the `next' command , at `2' the newline ist printed as a result
of the gdb `call'.  This is what I referred to as `fwrite works when
called from gdb'.  I can even muck with the str:

    (gdb) set str = "ho\n"
    (gdb) set len = 3
    (gdb) p str
    $29 = "ho\n"
    (gdb) call fwrite (str, 1, len, (&__iob[1]))
    $30 = 3

I'm trying the CVS gcc version, though this will take some time,

reply via email to

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