This is the mail archive of the mailing list for the eCos project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 1001466] /dev/null serial driver

Please do not reply to this email. Use the web interface provided at:

--- Comment #9 from Sergei Gavrikov <> 2012-02-16 15:57:43 GMT ---
(In reply to comment #6)

> Maybe the proper solution is in the stdio lib?

My check for eCos fopen("/dev/null", ...) from the box

The eCos template:

  cdl_configuration eCos {
      template    default ;
      package CYGPKG_IO_FILEIO current ;

Example of GDB session:

  % arm-eabi-gdb -q examples/hello
  (gdb) target remote /dev/ttyUSB0
  Remote debugging using /dev/ttyUSB0
  0x00002d48 in ?? ()
  (gdb) load
  Loading section .rom_vectors, size 0x40 lma 0x81008000
  Loading section .text, size 0x9714 lma 0x81008040
  Loading section .rodata, size 0x344 lma 0x81011754
  Loading section .data, size 0x484 lma 0x81011a98
  Start address 0x81008040, load size 40732
  Transfer rate: 3 KB/sec, 299 bytes/write.
  (gdb) b main
  Breakpoint 1 at 0x81008534: file hello.c, line 7.
  (gdb) b exit
  Breakpoint 2 at 0x81010ad0: file
line 74.
  (gdb) cont
  [New Thread 2]
  [Switching to Thread 2]

  Breakpoint 1, main () at hello.c:7
  7        FILE           *fh = fopen("/dev/null", "r+");
  (gdb) l
  2    #include <stdlib.h>
  4    int
  5    main(void)
  6    {
  7        FILE           *fh = fopen("/dev/null", "r+");
  8        fprintf(stdout, "Hello, eCos world! (at stdout)\n");
  9        fprintf(fh, "Hello, eCos world! (at /dev/null)\n");
  10        fclose(fh);
  11        fprintf(stdout, "Bye! (at stdout)\n");
  (gdb) cont
  Hello, eCos world! (at stdout)
  Bye! (at stdout)

  Breakpoint 2, exit (status=0)
  74    exit( int status )
  Current language:  auto; currently c++

And what you get?

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]