PDA

View Full Version : GDB debugger in QT Developer behaves unexpectedly



KanareykaVBusikah
4th October 2013, 10:22
Hello!

I have some difficulties with understanding what I see in gdb output.
Well, I thought I am experienced enough to understand - today is far from my first day in programming and debugging
(I am a newbie only in QT, and have some experience in C++, but not much).
But I see the variable values - and I don't understand WHY such values.

I described my problems with GDB in another topic (because it all started from the other problem) - see post http://www.qtcentre.org/threads/56159-QTreeView-QAbstractItemModel-QSortFilterProxyModel-insertRows-fails?p=252323#post252323
There are detailed description and screenshots.

Hope someone will give me a hint, why I see what I see. Thank you.

KanareykaVBusikah
8th October 2013, 08:44
Up!

It is almost impossible to continue development when your debugger works odd.
I hope very much to get a hint on the problem in the 1st post of the current topic.

KanareykaVBusikah
11th October 2013, 10:36
Hello again!

I have made a minimal example, describing my debugger strange behaviour.
TreeViewExample.zip (http://rapidshare.com/share/D641E6EB2E75999EA4D9C6FCA49B2F9C)

Here it is.
There is some excessiveness, like:
- TreeView is not enclosed into MainWindow directly, but into QDialogue (enclosed into MainWindow);
- initial data in tree are monstrously hardcoded (see ExObject constructor);
- order field calculation is left.

How to do with this:

- Open TreeViewExample.W.pro in QT Creator;
- open ExFS.cpp, set breakpoing at line 34;
- run application in debug mode: a window will be opened, 2 widgets are there:
text field and tree view;
- in tree view - click to "x20" branch (make it to be selected);
- in text field print new branch name ("x25" for example)
(it is supposed, that "x25" branch is inserted after selected "x20");
- whatch the debuger output.

Here is a couple of my screenshots again:
9686

This first shows debuger stopped at 34 line, then moved to the next line.
Here we can see index - it is ok (column 0, row 9 on the screenshot; in the example attached - it will be column 0, row 1).

9687

The second screenshot shows state after 3 next steps:

1) "(invalid)" sourceIndex (I expect it to be valid)
2) index turned to (column 0, row 0) when entered into "else"

My configuration is QT Creator 2.7.2 + QT 5.1.0 (32bit) + MinGW.

Can anyone tell me, why my debugger works like this?
Does your debugger behave likewise on this project?