216

Those who use Visual Studio will be familiar with the Shift + F11 hotkey, which steps out of a function, meaning it continues execution of the current function until it returns to its caller, at which point it stops.

Is there an equivalent in GDB?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
sashoalm
  • 75,001
  • 122
  • 434
  • 781

1 Answers1

327

You can use the finish command.

finish: Continue running until just after function in the selected stack frame returns. Print the returned value (if any). This command can be abbreviated as fin.

(See 5.2 Continuing and Stepping.)

Jason
  • 920
  • 8
  • 19
rje
  • 6,388
  • 1
  • 21
  • 40