A finish breakpoint is a temporary breakpoint set at the return address of
a frame, based on the
gdb.Breakpoint. The underlying breakpoint will be disabled
and deleted when the execution will run out of the breakpoint scope (i.e.
Finish breakpoints are thread specific and must be create with the right
frameis not provided, this defaults to the newest frame. The optional
internalargument allows the breakpoint to become invisible to the user. See Breakpoints In Python, for further details about this argument.
In some circumstances (e.g.
++ exceptions, GDB
return command, …), a function may not properly terminate, and
thus never hit the finish breakpoint. When GDB notices such a
out_of_scope callback will be triggered.
You may want to sub-class
gdb.FinishBreakpoint and override this
class MyFinishBreakpoint (gdb.FinishBreakpoint) def stop (self): print "normal finish" return True def out_of_scope (): print "abnormal finish"
gdb.FinishBreakpointobject had debug symbols, this attribute will contain a
gdb.Valueobject corresponding to the return value of the function. The value will be
Noneif the function return type is
voidor if the return value was not computable. This attribute is not writable.