How to set a breakpoint in GDB where the function returns?

c++, debugging, gdb

Solution

break without arguments stops execution at the next instruction in the currently selected stack frame. You select strack frames via the `frame` or `up` and `down` commands. If you want to debug the point where you are actually leaving the current function, select the next outer frame and break there.

Problem

I have a C++ function which has many return statements at various places. How to set a breakpoint at the return statement where the function actually returns ? And what does "break" command without argument means?

Original source

Related problems