PDA

View Full Version : QTCreator Mac - Unable to debug properly?



regrant
6th October 2010, 13:03
Hi all,

A few weeks ago I bought a MacBook i5 (10.6.4) and I imported all my
projects using GIT (before I was working on Ubuntu). I installed
Qt Creator for Mac:

Qt Creator 2.0.0
Based on Qt 4.7.0 (64 bit)

Built on Jun 18 2010 at 03:44:58

From revision 1c0f52a091

Everything seems to be fine except the debugging. Although
Debugging Helper is on, this simple code:

#include <vector>
#include <iostream>

int main(void)
{
std :: vector < int > jp;
for (size_t i = 0; i < 10; i++)
jp.push_back(i);

std :: cout << "jp: ";
for (size_t i = 0; i < jp.size(); i++)
std :: cout << jp[i] << " ";
std :: cout << std :: endl;

return 0;
}

is not debugged properly. For example, setting a
breakpoint at the line "std :: cout << "jp: ";" works
but QTCreator is unable to properly display the contents
of the vector "jp". Moreover, after a while a pop up
is shown saying:

The gdb process has not responded to a command within 20 seconds. This could mean it is stuck in an endless loop or taking longer than expected to perform the operation.
You can choose between waiting longer or abort debugging.

I thought it might be related to the compiler version:

GNU gdb 6.3.50-20050815 (Apple version gdb-1472) (Wed Jul 21 10:53:12 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".

So I download and compile the last version of the gdb:

GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin10".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.

I also set the permissions using:

codesign -s gdb-cert /Users/jpc/usr/bin/gdb
codesign -s gdb-cert /Users/jpc/usr/bin/gdb

But using this version, QTCreator complains saying:

The inferior stopped because it received a signal from the Operating System.

Signal name :
SIGSEGV
Signal meaning :
Segmentation fault

Now I don't really know what to try next...could you help me out
guys?

Thanks in advance.

regrant
8th October 2010, 16:19
* Update * Today I downloaded and installed QT Creator 2.1 beta from
http://qt.nokia.com/developer/qt-qtcreator-prerelease#download

Now when debugging the gdb (6.3) doesn't crash but I am still unable
to see the content of STL containers (see example in previous post).
Debug Helper is re-compiled for this version and activated. Any clue?
:confused:

Thanks

regrant
11th October 2010, 03:16
Ok folks, I figured it all out. It works know. I think this had to do with the support x86 & x86_64
rather than to the compiler version. What I did is:

1) Remove QT & QT Creator:
sudo /Developer/Tools/uninstall-qt.py
2) Remove Xtools (Developer tools)
sudo /Developer/Library/uninstall-devtools --mode=all
3) Install Xtools (supporting apps for 10.4)
4) Install Qt 4.7
5) Install Qt Creator 2.0.1beta

I run the build for Debugging Helper in Preferences, and the
same example works as charm :)

I hope this helps someone.:cool:

regrant
28th October 2010, 23:29
I am experiencing a new problem with QtCreator. I am unable to
set the content of STL containers when debugging if these are
define using typdef. For example, With something like:

std::vector<int> myVector,

I am able to see its content with no problems. However, with:

typdef std::vector<int> tVector;
tVector myVector;

It doesn't work. It's not able to show the content. It's like it
wouldn't have the debugging helper on.

This wouldn't be a big issue, but all my code has typedef.
I tried with the last official version and with the nightly build,
but the problem persists.

Do you know if this is a known issue? does this catalogs as
a bug?

Thanks.