Is there a way to tell GDB to crash right after this function returns?
If you are going to perform a function n[ext]. If you are inside, fin[ish]it will stop when it returns and display the return value.
n[ext]
fin[ish]
You can add a breakpoint to the function and then finishexit.
finish