How to see return value in Qt Creator (gdb)

One can see the return value by stepping out of the function (using the "Step Out" button or the F11 key in the Windows version of Creator) in the GUI.

Note that exiting the function by single stepping (using the Step Over button or F10 in the Windows version of Creator) does not provide the result.

When stepping out, the return value is shown in the Locals and Expressions View in a window that pops up between the stack variables and the expression evaluators.

It would be nice to always be able to see the return value of the most recently exited function, but it appears that gdb does not readily support it, so it may be unlikely that Creator will support it anytime soon. Anyway, using the Step Out feature anytime the return value is needed is a sufficient workaround.

Tags:

Gdb

Qt

Qt Creator