Hi,

Compile and debug

#include <fstream>
int main() {
  std::ofstream f("foo.txt");
}

g++ a.cpp -g
gdb
b main
r
n
print f

with MinGW 4.82 (and 4.91) on Windows 7 I get:

$1 = <incomplete type>

whereas with gcc 4.82 on Ubuntu 14 I get the full type:

(gdb) print f
$1 = {<std::basic_ostream<char, std::char_traits<char> >> =
{<std::basic_ios<char, std::char_traits<char> >> = {<std::ios_base> = {
        _vptr.ios_base = 0x7ffff7dc1e40 <vtable for
std::basic_ofstream<char, std::char_traits<char> >+64>,
...

That is a problem for every type compiled in libstdc++, not just ofstream.

The problem seems to be MinGW libstdc++ is missing debug info or it's not
loaded properly:

(gdb) info sharedlibrary
>From        To          Syms Read   Shared Object Library
0x6fc41000  0x6fd32e00  Yes *(*)*
C:\Users\yaron\Downloads\mingw32\bin\libstdc++-6.dll
*(*): Shared library is missing debugging information.*

(gdb) info sharedlibrary
>From                To                  Syms Read   Shared Object Library
0x00007ffff7b315c0  0x00007ffff7b9499a  Yes
/usr/lib/x86_64-linux-gnu/libstdc++.so.6

Yaron
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to