Results 1 to 9 of 9

Thread: Problem with debbuging under windows 7

  1. #1
    Join Date
    Mar 2014
    Posts
    7
    Thanks
    1
    Qt products
    Qt5

    Default Problem with debbuging under windows 7

    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!

  2. #2
    Join Date
    Oct 2012
    Posts
    132
    Thanks
    10
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Problem with debbuging under windows 7

    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.)

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem with debbuging under windows 7

    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.

  4. #4
    Join Date
    Mar 2014
    Posts
    7
    Thanks
    1
    Qt products
    Qt5

    Default Re: Problem with debbuging under windows 7

    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!

  5. #5
    Join Date
    Mar 2014
    Posts
    7
    Thanks
    1
    Qt products
    Qt5

    Default Re: Problem with debbuging under windows 7

    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...

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem with debbuging under windows 7

    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.

  7. #7
    Join Date
    Mar 2014
    Posts
    7
    Thanks
    1
    Qt products
    Qt5

    Default Re: Problem with debbuging under windows 7

    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...

  8. #8
    Join Date
    Mar 2014
    Posts
    7
    Thanks
    1
    Qt products
    Qt5

    Default Re: Problem with debbuging under windows 7

    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 ?


    Qt Code:
    1. bool LogFileAnalizer::BuildTransactionVector( QString& error )
    2. {
    3. // clear previous data
    4. _transactions.clear();
    5.  
    6. // constants used
    7. const Char BeginMark = _pVersion->GetBeginMark();
    8. const Char EmptyMark = _pVersion->GetEmptyMark();
    9. const Char EmptyMemoryId = _pVersion->GetUnusedMemTransactionId();
    10. const Char WrongMemoryId = _pVersion->GetWrongMemoryTransactionId();
    11. const Char RootBeginId = 0x35; //!! hardcoded, change later
    12. const Char RootEndId = 0x38; //!! hardcoded, change later
    13. const Char RootContId = 0x39; //!! hardcoded, change later -> works like RootEndId
    14. const Int MinEmptyDataSize = 128; // minimum continous empty mark size to treat it as empty space (not trans param) !! hardcoded - change later
    15.  
    16. // data pointers
    17. Char* fileBegin = _data; // file begin
    18. Char* fileEnd = _data + _fileSize; // file end
    19. Char* dataBegin = 0; // transactions data begin - to find
    20. Char* dataEnd = 0; // transactions data end - to find
    21.  
    22. // cursors
    23. Char* pos = _data; // position to go through buffer
    24. Char* end = _data + _fileSize; // buffer end postion
    25.  
    26. // FIND EMPTY BUFFER END TRANSACTION ENTRY BEGIN AND END
    27. // go to first transaction
    28. while(( *pos != BeginMark && pos < end ) || (( pos + 1 ) < end && *pos == BeginMark && *( ++pos ) == BeginMark )) // second condition skips double BeginMark which means a normal data
    29. {
    30. ++pos;
    31. }
    32. ....
    To copy to clipboard, switch view to plain text mode 

  9. #9
    Join Date
    Mar 2014
    Posts
    7
    Thanks
    1
    Qt products
    Qt5

    Default Re: Problem with debbuging under windows 7

    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.

Similar Threads

  1. A problem with MDI windows
    By Datakim in forum Newbie
    Replies: 13
    Last Post: 17th April 2012, 08:12
  2. Debbuging
    By Maluko_Da_Tola in forum Newbie
    Replies: 2
    Last Post: 21st August 2010, 00:00
  3. Replies: 0
    Last Post: 8th April 2010, 22:06
  4. Replies: 19
    Last Post: 3rd April 2009, 23:17
  5. problem with Qt/ Windows--pls help
    By swamyonline in forum Installation and Deployment
    Replies: 8
    Last Post: 7th July 2008, 20:39

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.