[Qt-creator] how to attach sources for debugging?

Andre Poenitz andre.poenitz at mathematik.tu-chemnitz.de
Sat May 22 11:40:39 CEST 2010


On Fri, May 21, 2010 at 11:05:11PM +0300, Aekold Helbrass wrote:
> I am using NetBeans (Java) for my everyday work, so I'll describe it
> as example:
> 
> Let's assume our line of code looks like this:
> painter.drawText(getX(), getY(), getString());
> 
> When you're pressing "step into" in NetBeans it highlights all step
> into possibities, four of them in example above, and highlights one of
> them as default one, so you can press step into once again to go into
> default one or you can click with your mouse on any other to step into
> it. Then, when you're stepped all your way up to the end of getX() for
> example you're returned to the same line, with one function marked as
> visited, and you can step into another one.

But that's debugging Java, not C++?

For a fair comparison you would have to compare NetBeans for C++ with Qt
Creator, and given that it uses gdb as backend I strongly doubt the 
functionality you describe exists there.

We are more or less restricted to what the debugging backend (gdb in
this case) provides, and gdb does not have such 'list all function calls
in this line' kind of capability.

When I think about it. We could try to use information from the code
model and temporary breakpoints to simulate this. I guess we will run
into "interesting" behaviour for inlined code, though. Maybe it's still
worth a shot.
 
> In QtCreator it steps in the first one to execute (getX() in our
> case), and when you're stepping over the internals of function up to
> the end - Qt Creator will not show you the original line again with
> possibility to step into next function but will act as step over it.

I know this is unfortunate, but again, there's no way to know in advance
whether a 'step over' will leave the current function or not, so there
is not much choice except to provide a separate command to specifically
step out of a function (Shift-F11).

> So it took me some time to understand that I should press "step into"

[Rather "step out"...]

> on the last lines of getX() to step into getY(), but I can't just skip
> them and step directly into drawText().

Yes, it would be seven keystrokes in this case.

Andre'



More information about the Qt-creator-old mailing list