additional cfinish command (patches for gdb command file)
finish
leave the current active stack element, which cannot be used for programs or sections as those aren't (necessary) one C function.
I'd suggest to add a new command to work around this. Here are some hints for the necessary code:
cfinish-program: until exit_program; finish; finish
cfinish-function: until exit_function; finish; finish
cfinish-module: the two above but conditionaö
cfinish-perform-out-of-line: until *frame_ptr->return_address_ptr
cfinish-perform-inline: currently has to check for loop exit (EXIT PERFORM
also jumps there - in this case generates an "implicit EXIT label") and use until
there, I'm looking at inserting something similar like the frame_ptr to ease this. Using until
should also "catch" GOBACK / EXIT PROGRAM|FUNCTION
as those are on a different statck trace
cfinish-perform-continue: similar like cfinish-perform-inline, until
just before the end of the loop (EXIT PERFORM CYCLE
also jumps there - in this case generates an "implicit EXIT label".