August 23, 2011

styne666 styne666
Lab Rat
4 posts

Why would using “qDebug() << someValue;” cause gdb in Eclipse to hang with “(Running : User Request)”?

 

Hello all,

I’m trying to print out availableMibs() using this loop…

  1. QList<int> myAvailableMibs = QTextCodec::availableMibs();
  2.  
  3. for (i = 0; i < myAvailableMibs.size(); i++) {
  4.     currentCodec = QTextCodec::codecForMib(myAvailableMibs.at(i));
  5.     qDebug() << myAvailableMibs.at(i) << "=" << currentCodec->name();
  6. }

…which is in a static method in a user-defined class which is called by my main().

When I run the PE from the command line it works fine. However when I try and run it in Eclipse with the MinGW gdb it runs up until a certain index in myAvailableMibs then the thread goes into a

  1. Thread[1] 0 (Running : User Request)

state which it never returns from.

  1. qDebug();

…on its own returns fine so I believe its something to do with the << operator. Changing the number of << operators used in that statement changes the position in the QList at which it enters the “(Running : User Request)” state, but I can’t find any direct correlation between the number of << operators and the position in the QList.

The only clue I can see is is the

  1. Thread[1] 0 (Running : User Request)

message in the Debug panel. I am actually trying to solve another problem with actual Mib values which this is hindering.

Does anyone have any thoughts or suggestions (other than don’t use the gdb in Eclipse)?

Many thanks,
Sam

[EDIT: code formatting for error to avoid superscript, Volker]

0 replies

 
  ‹‹ [Solved] Two different orientations in one print      Mistake in QT DOC ? ››

You must log in to post a reply. Not a member yet? Register here!