[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cdtest.exe problem under psim
- Date: Fri, 07 May 1999 14:14:37 -0400
- From: jskulpin at eng01.gdds.com (Jay Kulpinski)
- Subject: cdtest.exe problem under psim
Destructors for static objects are being called twice. The
libc_wrapup()
call in the patch below seems to be the culprit. Based on the comment,
it appears the author wasn't sure it should be there. It does cause
trouble as it was.
This is my configuration:
BINUTILS=binutils-2.9.1
GCC=egcs-1.1.2
NEWLIB=newlib-1.8.1
GDB=gdb-4.17
BUILD_DOCS=no
BUILD_OTHER_LANGUAGES=no
INSTALL_POINT=/home/jskulpin/ppc-rtems
RTEMS=rtems-19990426
BSP=all
ENABLE_RTEMS_POSIX=yes
ENABLE_RTEMS_TESTS=no
ENABLE_RTEMS_TCPIP=yes
ENABLE_RTEMS_CXX=yes
rtems-new/tools:(312)% diff -c
rtems-19990426/c/src/lib/libc/newlibc.c{-orig,}
*** rtems-19990426/c/src/lib/libc/newlibc.c-orig Fri May 7
11:20:31 1999
--- rtems-19990426/c/src/lib/libc/newlibc.c Fri May 7 11:21:08 1999
***************
*** 363,369 ****
--- 363,371 ----
#if !defined(RTEMS_UNIX) && !defined(_AM29K)
void _exit(int status)
{
+ #if 0
libc_wrapup(); /* Why? XXX */
+ #endif
rtems_shutdown_executive(status);
}
psim/samples:(266)% powerpc-rtems-gdb cdtest.exe
GNU gdb 4.17
Copyright 1998 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
conditions.
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=i586-pc-linux-gnu
--target=powerpc-rtems"...
(gdb) target sim -r 0x800000
Connected to the simulator.
(gdb) load
(gdb) run
Starting program: /epi/jskulpin/ppc-rtems/psim/samples/cdtest.exe
Hey I'm in base class constructor number 1 for 0x2dc50.
Hey I'm in base class constructor number 2 for 0x2dc48.
Hey I'm in derived class constructor number 3 for 0x2dc48.
*** CONSTRUCTOR/DESTRUCTOR TEST ***
Hey I'm in base class constructor number 4 for 0x7e8950.
Hey I'm in base class constructor number 5 for 0x7e8968.
Hey I'm in base class constructor number 6 for 0x7e8980.
Hey I'm in base class constructor number 7 for 0x7e8998.
Hey I'm in derived class constructor number 8 for 0x7e8998.
IO Stream not tested
Hey I'm in derived class destructor number 8 for 0x7e8998.
Derived class - Instantiation order 8
Hey I'm in base class destructor number 7 for 0x7e8998.
Instantiation order 8
Hey I'm in base class destructor number 6 for 0x7e8980.
Instantiation order 6
Hey I'm in base class destructor number 5 for 0x7e8968.
Instantiation order 5
Hey I'm in base class destructor number 4 for 0x7e8950.
Instantiation order 5
*** END OF CONSTRUCTOR/DESTRUCTOR TEST ***
Hey I'm in derived class destructor number 3 for 0x2dc48.
Derived class - Instantiation order 3
Hey I'm in base class destructor number 2 for 0x2dc48.
Instantiation order 3
Hey I'm in base class destructor number 1 for 0x2dc50.
Instantiation order 1
[ note that these last three are called again ]
Hey I'm in derived class destructor number 0 for 0x2dc48.
Derived class - Instantiation order 3
Hey I'm in base class destructor number -1 for 0x2dc48.
Instantiation order 3
Hey I'm in base class destructor number -2 for 0x2dc50.
Instantiation order 1
Program exited normally.
(gdb) quit