[Qt-creator] Qt Creator debugging views question

André Pönitz apoenitz at t-online.de
Wed Aug 12 00:59:21 CEST 2020

On Tue, Aug 11, 2020 at 10:10:46PM +0000, Murphy, Sean wrote:
> When debugging code, is there a way to see the return values of individual calls within a complex conditional? For example, if I've got the following code:
> QString a;
> QString b;
> QString c;
> // ... a bunch of code that manipulates the above strings
> if(a.isEmpty() || b.isEmpty() || c.isEmpty())
> {
>   // do something
> } else {
>   // do something else
> }
> If I set a breakpoint on or above the "if" line, and then step using the "Step
> Over" button, I see the cursor bounce around the "if" line a couple times as I
> press it, and eventually based on the result of the entire conditional I see I
> see the current line of code move into one or the other sections. But how do I
> see the return values of each of the individual isEmpty() calls, so I can see
> which one (or ones) was the culprit for whatever happened.

With gdb, the return value is only produced on 'Step Out' operations.

So you'd need to Step In (<F11>) into each isEmpty() call, and Step Out 
(<Shift-F11>) at anytime later, e.g. also immediately, would run until
the function exits and also produce the return value.


More information about the Qt-creator mailing list