This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: uSTL hello world
- From: cetoni GmbH - Uwe Kindler <uwe dot kindler at cetoni dot de>
- To: John Dallaway <john at dallaway dot org dot uk>
- Cc: ecos-discuss at sourceware dot org
- Date: Tue, 08 Sep 2009 17:13:34 +0200
- Subject: [ECOS] Re: uSTL hello world
- References: <4A97F60C.2030208@dallaway.org.uk> <4A9CDD08.7090408@cetoni.de> <4A9D2171.30108@dallaway.org.uk>
Hi John,
Back to the original problem. It may be easiest to drill down into the
cout call hierarchy under debug and compare with the equivalent call
stack from a working application in order to narrow the problem search
space.
John Dallaway
O.k. - I did this and here are my results.
In both situations (reference to printf exists and no reference to
printf exists in main.cpp) the call cout << "Hello world!\n" brings us
into the function readwritev() in fileio/io.cxx. In this file the lines
105 - 108 makes the difference:
fp = cyg_fp_get( fd );
if( fp == NULL )
FILEIO_RETURN(EBADF);
If a printf call is present in main.cpp then cyg_fp_get() returns a
valid file pointer. If no printf call is present in main.cpp the
cyg_fp_get() returns 0 and the function returns with EBADF.
Here are the local variables in readwritev() with printf:
fd 0x1
_iov 0xa0140948
iov_len 0x1
direction 0x2
cnt 0xd
len 0xd
ret 0x11110008
_idx 0x1
fp 0xa0140d90
iov 0xa014086c
uio {...}
op 0xa014095c
and here are the locals in readwritev() without printf in main:
fd 0x1
_iov 0xa013d5e8
iov_len 0x1
direction 0x2
cnt 0x11110006
len 0xd
ret 0x11110008
_idx 0x1
fp 0x00000000
iov 0xa013d50c
uio {...}
op 0xa013d5fc
Any idea what is going wrong here before I dig even more deeper?
Regards, Uwe
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss