Finish Breakpoints in Python (Debugging with GDB)
Next: Lazy Strings In Python, Previous: Breakpoints In Python, Up: Python API [Contents][Index]
23.3.2.31 Finish Breakpoints
A finish breakpoint is a temporary breakpoint set at the return address of a frame, based on the finish command. gdb.FinishBreakpoint extends gdb.Breakpoint. The underlying breakpoint will be disabled and deleted when the execution will run out of the breakpoint scope (i.e. Breakpoint.stop or FinishBreakpoint.out_of_scope triggered). Finish breakpoints are thread specific and must be create with the right thread selected.
- Function
- FinishBreakpoint.__init__ ([frame] [, internal])
- Create a finish breakpoint at the return address of the
gdb.Frameobjectframe. Ifframeis not provided, this defaults to the newest frame. The optionalinternalargument allows the breakpoint to become invisible to the user. See Breakpoints In Python, for further details about this argument.
- Function: FinishBreakpoint.out_of_scope (self)
In some circumstances (e.g.
longjmp, C++ exceptions, GDBreturncommand, …), a function may not properly terminate, and thus never hit the finish breakpoint. When GDB notices such a situation, theout_of_scopecallback will be triggered.You may want to sub-class
gdb.FinishBreakpointand override this method:class MyFinishBreakpoint (gdb.FinishBreakpoint) def stop (self): print ("normal finish") return True def out_of_scope (): print ("abnormal finish")
- Variable
- FinishBreakpoint.return_value
- When GDB is stopped at a finish breakpoint and the frame used to build the
gdb.FinishBreakpointobject had debug symbols, this attribute will contain agdb.Valueobject corresponding to the return value of the function. The value will beNoneif the function return type isvoidor if the return value was not computable. This attribute is not writable.
Next: Lazy Strings In Python, Previous: Breakpoints In Python, Up: Python API [Contents][Index]