[Qt-creator] Loading source files while debugging mingw app with gdb
Piotr Dobrogost
pd at qtlists.qt.dobrogost.pl
Sat Mar 12 13:00:30 CET 2011
Hi!
I'm on Windows using mingw 4.4.0 installed (in c:\mingw\4.4.0-qt) some time ago by Creator's installer. I have the following test app:
#include <ext/stdio_filebuf.h>
#include <iostream>
#include <fstream>
#include <string>
#include <QtCore>
using namespace std;
int main()
{
ofstream ofs("test.txt");
ofs << "Writing to a basic_ofstream object..." << endl;
ofs.close();
int posix_handle = fileno(::fopen("test.txt", "r"));
__gnu_cxx::stdio_filebuf<char> filebuf(posix_handle, std::ios::in);
istream is(&filebuf);
string line;
getline(is, line);
cout << "line: " << line << std::endl;
return 0;
}
which I compiled in debug mode from within Creator. During debugging, files in backtrace like fstream, fstream.tcc and others weren't loaded. I noticed in tooltips when hovering over them they have paths like \mingw\src\gccbf\mingw32\libstdc++-v3\include so I used Options/Debugger/Source Paths Mapping to map \mingw\src\gccbf\mingw32\libstdc++-v3\include path to C:\MinGW\4.4.0-qt\lib\gcc\mingw32\4.4.0\include\c++. This made these files available to debugger which started to load them during debugging.
My question is this; why debugger had no problem loading stdio_filebuf.h file (which is gcc's extension and lives in c:\mingw\4.4.0-qt\lib\gcc\mingw32\4.4.0\include\c++\ext\stdio_filebuf.h while it was unable to load other files?
I'll add that pressing F2 in Creator's editor finds both stdio_filebuf.h _and_ fstream header files.
--
Piotr Dobrogost
"Break C++ and the major implementations of Java and C# would also break" - Bjarne Stroustrup
More information about the Qt-creator-old
mailing list