PDA

View Full Version : Problem with debbuging under windows 7



wyder
8th March 2014, 20:40
Hello,

i am new in QT (but experienced in c++ )
I writting application in Qt Creator:

Qt Creator 3.0.1
Based on Qt 5.2.1 (MSVC 2010, 32 bit), compiler used is MinGW 4.8 32bit

I have big problem when i debug my aplication: peek value of variable is almost impossible,
often there is a huge lag, step by step debuging usually skip to some strange, unlogical
place and sometimes the gdborig.exe process in the systems consumes up to 1GB memory,
and full processor time and not responding...

I have no idea where is the problem, please help!

Infinity
9th March 2014, 03:01
Based on Qt 5.2.1 (MSVC 2010, 32 bit), compiler used is MinGW 4.8 32bit
Libraries compilled with MSVC are not binary compatible with MinGW. Have you already tried to use the "MinGW version" of Qt? (This version also includes the MinGW compiler with gdb.)

ChrisW67
9th March 2014, 05:03
The distributed Qt Creator binaries are created with 32-bit MSVC2010. I think OP's project is built with the 32-bit MingW compiler and matching Qt libraries.

I would start by doing a complete clean build of the project and making sure there are no zombie copies of your program running.

wyder
9th March 2014, 14:35
HEllo, i have installed VS version before, but i have "can not setup debugger"
so i have installed then MinGW version. Probably my aplication is compiled by
VS compiler, but Qt try debug it by debuger for MinGW.

I have clean my environment, reinstall Qt VS version and now try to install
win SDK and configure debugger. I hope it solfe the problem.

Thanks for responses!

wyder
9th March 2014, 22:40
Ech... I wasn't able to install MS SDK... FU**ING PC!!

Finally i have installed fresh MinGW version on virtual machine - windows XP.
At start it works great on some sample project.

When i import my projects, i have same problems during debugging: Huge lag,
can't see values of variables, gdborig.exe (debugging process?? ) take up to
1GB memory and 100% CPU time...

What i have to do to make single working program on that environment!!!???
I have lost many time, and have no effects...

Could be a reason using STL structures ? I use vector, stack, etc...

ChrisW67
9th March 2014, 23:17
What do you mean "import my projects"?

You make a single working program in that environment by taking a set of source code, and compiling and linking it with a compatible toolchain and Qt libraries, and running it using a matching debugger. If you use the 32-bit MingW compiler and Qt library bundled in the official Qt Project then you use gdb to debug it. If you use Microsoft's compiler then you need a matching set of Qt libraries and Microsoft's debugger. In both cases the program must be compiled in debug mode so that meaningful single-step and source code debugging is possible.

Start with a simple "Hello World" program, set a breakpoint on the first line of main() and run it in the debugger.

wyder
10th March 2014, 08:28
What do you mean "import my projects"?

I mean i create new project in fresh installed environment from scratch,
then copy my cpp and h files, add to the project and build.

It was build successffuly, config is ok too - MinGW Compiler and proper
debuger ( there is no VS installed on machine ). Buy there are same
problems with debugging.

Like Chris said - i will start again from simple project. I it will
work i try to switch STL structures on my project with Qt, like
QList, QStack etc...

wyder
10th March 2014, 11:58
I have removed includes not connected with Qt (windows.h, map, vector ),
i use only includes started with Q. I use QFile instead of CreateFile etc...

When i enter the code below, and make breakpoint on some line, when it break,
then I hit F10 and program suspends... 100% CPU, +500MB memory used and
growing...

And don't know what is wrong.
Before mentioned function i open the file, allocate 8MB memory on heap for
file data, and close the file ...

any suggestions ?




bool LogFileAnalizer::BuildTransactionVector( QString& error )
{
// clear previous data
_transactions.clear();

// constants used
const Char BeginMark = _pVersion->GetBeginMark();
const Char EmptyMark = _pVersion->GetEmptyMark();
const Char EmptyMemoryId = _pVersion->GetUnusedMemTransactionId();
const Char WrongMemoryId = _pVersion->GetWrongMemoryTransactionId();
const Char RootBeginId = 0x35; //!! hardcoded, change later
const Char RootEndId = 0x38; //!! hardcoded, change later
const Char RootContId = 0x39; //!! hardcoded, change later -> works like RootEndId
const Int MinEmptyDataSize = 128; // minimum continous empty mark size to treat it as empty space (not trans param) !! hardcoded - change later

// data pointers
Char* fileBegin = _data; // file begin
Char* fileEnd = _data + _fileSize; // file end
Char* dataBegin = 0; // transactions data begin - to find
Char* dataEnd = 0; // transactions data end - to find

// cursors
Char* pos = _data; // position to go through buffer
Char* end = _data + _fileSize; // buffer end postion

// FIND EMPTY BUFFER END TRANSACTION ENTRY BEGIN AND END
// go to first transaction
while(( *pos != BeginMark && pos < end ) || (( pos + 1 ) < end && *pos == BeginMark && *( ++pos ) == BeginMark )) // second condition skips double BeginMark which means a normal data
{
++pos;
}
....

wyder
10th March 2014, 23:26
Finally i removed F**ing windows and i have installed Ubuntu.
It's my first day on linux but I am quite pleased.

Program and debugger work well now.

Finally i have opportunity to work on linux, i hopy it will be great experience.

Problems in running Qt on my windows was probably becouse of damage
system and some exotic settings (ewf mngr etc... ).

Thanks for help, i think thread can be deleted.