cdtest example using cout on psim problem

JP Bonn rtemsmail at
Thu Apr 15 22:04:10 UTC 2004

I'm trying to run the cdtest example on psim.  It works fine and gives
the expected results but if I set RTEMS_TEST_IO_STREAM and try using
cout it fails.  Is there additional configuration I have to do to get
stdio stuff to work?

[jpbonns-Computer:samples/cdtest/o-optimize] jp% ./psim-gdb ./cdtest.exe
GNU gdb 5.2
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=powerpc-apple-darwin7.3.0
Connected to the simulator.
Breakpoint 1 at 0x11ccc: file
../../../../../../rtems-4.6.0/cpukit/score/src/interr.c, line 51.
Breakpoint 2 at 0x11970: file
../../../../../../rtems-4.6.0/cpukit/sapi/src/fatal.c, line 34.
Breakpoint 3 at 0x23d6c: file
../../../../../../../gcc-3.2.3/newlib/libc/stdlib/assert.c, line 57.
(gdb) run
Starting program:

LOCAL: Hey I'm in base class constructor number 1 for 0x7e94e0.
LOCAL: Hey I'm in base class constructor number 2 for 0x7e94f0.
LOCAL: Hey I'm in base class constructor number 3 for 0x7e9500.
LOCAL: Hey I'm in base class constructor number 4 for 0x7e9510.
LOCAL: Hey I'm in derived class constructor number 5 for 0x7e9510.
core_find_mapping() - access to unmaped address, attach a default map to
handle this - addr=0xfffffff4 nr_bytes=0x4 processor=0x1c2d000 cia=0x4604c

(gdb) bt
#0  sentry (this=0x7e94a0, __os=@0x63ec4)
#1  0x00046370 in std::basic_ostream<char, std::char_traits<char> >&
std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*) (__out=@0x63ec4, 
    __s=0x525a8 "Testing a C++ I/O stream")
#2  0x00000580 in cdtest ()
#3  0x000008b4 in main_task ()
#4  0x00023d0c in _Thread_Handler ()
    at ../../../../../../rtems-4.6.0/cpukit/score/src/threadhandler.c:123
#5  0x00023bf4 in _Thread_Handler ()
    at ../../../../../../rtems-4.6.0/cpukit/score/src/objectgetbyindex.c:72
(gdb) frame 0
(gdb) info registers
r0             0x46370  287600
r1             0x7e9498 8295576
r2             0x0      0
r3             0x7e94a0 8295584
r4             0x63ec4  409284
r5             0x50000  327680
r6             0x1      1
r7             0x7e9348 8295240
r8             0x1      1
r9             0x7ddd25 8248613
r10            0x1      1
r11            0x0      0
r12            0x7fffffff       2147483647
r13            0x0      0
r14            0x0      0
r15            0x0      0
r16            0x0      0
r17            0x0      0
r18            0x0      0
r19            0x0      0
r20            0x0      0
r21            0x0      0
r22            0x0      0
r23            0x7e9500 8295680
r24            0x7e94f0 8295664
r25            0x7e9510 8295696
r26            0x7e94e0 8295648
r27            0x57478  357496
r28            0x525a0  337312
r29            0x525a8  337320
r30            0x63ec4  409284
r31            0x7e9498 8295576
pc             0x4604c  286796
ps             0xb042   45122
cr             0x28000042       671088706
lr             0x46370  287600
ctr            0x0      0
xer            0x20000000       536870912
(gdb) disas 0x4604c
Dump of assembler code for function sentry:
0x46040 <sentry>:       lwz     r11,0(r4)
0x46044 <sentry+4>:     mflr    r0
0x46048 <sentry+8>:     stw     r4,4(r3)
0x4604c <sentry+12>:    lwz     r9,-12(r11)
0x46050 <sentry+16>:    stwu    r1,-32(r1)
(gdb) p/x $4
$10 = 0x63ec4
(gdb) p/x *$4
$11 = 0x0

[jpbonns-Computer:tests/samples/cdtest] jp% make
mkdir o-optimize
powerpc-rtems-gcc --pipe -B../../../../../lib/
-B../../../../../psim/lib/ -specs bsp_specs -qrtems
-DPACKAGE_STRING=\"rtems-c-src-tests-samples\ 4.6.0\"
-DPACKAGE_BUGREPORT=\"rtems-bugs at\"    -isystem
../../../../../psim/lib/include     -mcpu=603e -D_OLD_EXCEPTIONS
-Dppc603e  -O4 -fno-keep-inline-functions -g -Wall -ansi -fasm  -o
o-optimize/init.o -c
powerpc-rtems-g++ -B../../../../../lib/ -B../../../../../psim/lib/
-specs bsp_specs -qrtems -DPACKAGE_NAME=\"rtems-c-src-tests-samples\"
-DPACKAGE_STRING=\"rtems-c-src-tests-samples\ 4.6.0\"
-DPACKAGE_BUGREPORT=\"rtems-bugs at\"    -isystem
../../../../../psim/lib/include     -mcpu=603e -D_OLD_EXCEPTIONS
-Dppc603e  -O4 -fno-keep-inline-functions -g -Wall -ansi -fasm  -o
o-optimize/main.o -c
powerpc-rtems-g++ -B../../../../../lib/ -B../../../../../psim/lib/
-specs bsp_specs -qrtems  -mcpu=603e -D_OLD_EXCEPTIONS -Dppc603e  -O4
-fno-keep-inline-functions -g -Wall -ansi -fasm    -o
o-optimize/cdtest.exe  o-optimize/init.o o-optimize/main.o  
/usr/bin/install -c o-optimize/cdtest.exe
/usr/bin/install -c o-optimize/cdtest.exe
[jpbonns-Computer:tests/samples/cdtest] jp%

The best kept secret in e-mail.

More information about the users mailing list