On Wed, 2009-07-08 at 07:31 +0100, Dave Korn wrote:
> Danny Backx wrote:
> 
> > - linker mentions ios_base::Init::Init()
> > - crash occurs, says gdb, in ios_base::Init __ioinit;
> > - gdbserver occasionally shows the glitch with reading dll names
> >   (Symbol file not found for li)
> 
> > Info: resolving std::cout  by linking to __imp___ZSt4cout (auto-import)
> > Info: resolving std::basic_ostream<char, std::char_traits<char> >&
> > std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
> > std::char_traits<char> >&, char const*) by linking to
> > __imp___ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
> > (auto-import)
> > Info: resolving std::ios_base::Init::Init() by linking to
> > __imp___ZNSt8ios_base4InitC1Ev (auto-import)
> > Info: resolving std::ios_base::Init::~Init() by linking to
> > __imp___ZNSt8ios_base4InitD1Ev (auto-import)
> > /opt/x86mingw32ce/lib/gcc/i386-mingw32ce/4.4.0/../../../../i386-mingw32ce/bin/ld:
> >  warning: auto-importing has been activated without --enable-auto-import 
> > specified on the command line.
> > This should work unless it involves constant data structures referencing
> > symbols from auto-imported DLLs.
> 
>   You really want to try adding -Wl,--enable-auto-import.  It's not kidding
> about "unless it involves constant data structures referencing symbols from
> auto-imported DLLs".

I know it's not kidding :-) I believe the cause of my problem is here
but I don't understand it fully.

Anyway, I tried that already, I don't see a difference. Tried it again
just now, debugging session below.

        Danny


\network\x86> gdbserver :9999 /network/x86/hello2.exe
Process /network/x86/hello2.exe created; pid = 90570762
Listening on port 9999
Remote debugging from host 172.17.1.10
Detaching from process 90570762




pavilion: {8} make
i386-mingw32ce-g++ -g -D_WIN32_IE=0x0400 -D_WIN32_WCE=0x0400 -g
-D_WIN32_IE=0x0400 -D_WIN32_WCE=0x0400 -Wl,--enable-auto-import -o
hello2.exe hello.C
pavilion: {9} cp hello2.exe ~/x86/
pavilion: {10} i386-mingw32ce-gdb hello2.exe 
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=i386-mingw32ce"...
(gdb) target remote ebox:9999
Remote debugging using ebox:9999
[New Thread 90636298]
Error while mapping shared library sections:
\network\x86\libgcc_s_sjlj-1.dll: No such file or directory.
Error while mapping shared library sections:
li: No such file or directory.
Error while mapping shared library sections:
\Windows\coredll.dll: No such file or directory.
Symbol file not found for \network\x86\libgcc_s_sjlj-1.dll
Symbol file not found for li
Symbol file not found for \Windows\coredll.dll
WinMainCRTStartup (hInst=0x566000a, hPrevInst=0x0, lpCmdLine=0x2801fc70,
nCmdShow=5)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/mingw/crt3.c:35
35      {
Current language:  auto; currently c
(gdb) s
41        _fpreset ();                  /* Supplied by the runtime
library. */
(gdb) 
44        _pei386_runtime_relocator ();
(gdb) 
_pei386_runtime_relocator ()

at 
/home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/mingw/pseudo-reloc.c:33
33        for (r = (runtime_pseudo_reloc*) start; r <
(runtime_pseudo_reloc*) end; r++)
(gdb) 
46      }
(gdb) 
WinMainCRTStartup (hInst=0x566000a, hPrevInst=0x0, lpCmdLine=0x2801fc70,
nCmdShow=5)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/mingw/crt3.c:49
49        __atexit_init();
(gdb) 
__atexit_init ()
at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/mingw/atexit.c:65
65        first_atexit = (p_atexit_fn*) malloc (32 * sizeof
(p_atexit_fn));
(gdb) 
66        if (first_atexit == NULL ) /* can't allocate memory */
(gdb) 
73        *first_atexit =  NULL;
(gdb) 
74        next_atexit = first_atexit;
(gdb) 
76      }
(gdb) 
WinMainCRTStartup (hInst=0x566000a, hPrevInst=0x0, lpCmdLine=0x2801fc70,
nCmdShow=5)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/mingw/crt3.c:54
54        __gccmain();
(gdb) 
__gccmain ()
at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/mingw/gccmain.c:79
79        if (!initialized)
(gdb) 
81            initialized = 1;
(gdb) 
86      }
(gdb) 
__gccmain ()
at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/mingw/gccmain.c:83
83            __mingw_do_global_ctors ();
(gdb) 
__mingw_do_global_ctors ()

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/mingw/gccmain.c:40
40      {
(gdb) 
41        unsigned long nptrs = (unsigned long) __CTOR_LIST__[0];
(gdb) 
49        if (nptrs == -1)
(gdb) 
58        for (i = nptrs; i >= 1; i--)
(gdb) 
60            __CTOR_LIST__[i] ();
(gdb) 
global constructors keyed to main () at hello.C:8
8       }
Current language:  auto; currently c++
(gdb) 
__static_initialization_and_destruction_0 (__initialize_p=1,
__priority=65535) at hello.C:8
8       }
(gdb) 
72        static ios_base::Init __ioinit;
(gdb) 
Cannot access memory at address 0x4235174a
(gdb) 
Cannot find bounds of current function
(gdb) up
#1  0x0040109e in _fu2___ZNSt8ios_base4InitC1Ev ()

at 
/opt/x86mingw32ce/lib/gcc/i386-mingw32ce/4.4.0/../../../../i386-mingw32ce/include/c++/4.4.0/iostream:72
72        static ios_base::Init __ioinit;
(gdb) fin
Run till exit from #1  0x0040109e in _fu2___ZNSt8ios_base4InitC1Ev ()

at 
/opt/x86mingw32ce/lib/gcc/i386-mingw32ce/4.4.0/../../../../i386-mingw32ce/include/c++/4.4.0/iostream:72

Program received signal SIGSEGV, Segmentation fault.
0x4235174a in ?? ()
(gdb) bt
#0  0x4235174a in ?? ()
#1  0x0040109e in _fu2___ZNSt8ios_base4InitC1Ev ()

at 
/opt/x86mingw32ce/lib/gcc/i386-mingw32ce/4.4.0/../../../../i386-mingw32ce/include/c++/4.4.0/iostream:72
#2  0x004010d5 in global constructors keyed to main () at hello.C:8
#3  0x00401322 in __mingw_do_global_ctors ()

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/mingw/gccmain.c:60
#4  0x0040101b in WinMainCRTStartup (hInst=0x566000a, hPrevInst=0x0,
lpCmdLine=0x2801fc70, 
    nCmdShow=5)
at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/mingw/crt3.c:54
(gdb) detach
Ending remote debugging.
(gdb) q
pavilion: {11} 

-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to