mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-31 18:20:12 +08:00
gdb
PR python/12367: * NEWS: Add item. * python/python.c (GdbMethods): Add "newest_frame" method. * python/python-internal.h (gdbpy_newest_frame): Declare. * python/py-frame.c (gdbpy_newest_frame): New function. gdb/doc * gdb.texinfo (Frames In Python): Document gdb.newest_thread. gdb/testsuite * gdb.python/py-frame.exp: Test gdb.newest_frame.
This commit is contained in:
@ -498,6 +498,26 @@ frapy_select (PyObject *self, PyObject *args)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* Implementation of gdb.newest_frame () -> gdb.Frame.
|
||||
Returns the newest frame object. */
|
||||
|
||||
PyObject *
|
||||
gdbpy_newest_frame (PyObject *self, PyObject *args)
|
||||
{
|
||||
struct frame_info *frame;
|
||||
PyObject *frame_obj = NULL; /* Initialize to appease gcc warning. */
|
||||
volatile struct gdb_exception except;
|
||||
|
||||
TRY_CATCH (except, RETURN_MASK_ALL)
|
||||
{
|
||||
frame = get_current_frame ();
|
||||
frame_obj = frame_info_to_frame_object (frame);
|
||||
}
|
||||
GDB_PY_HANDLE_EXCEPTION (except);
|
||||
|
||||
return frame_obj;
|
||||
}
|
||||
|
||||
/* Implementation of gdb.selected_frame () -> gdb.Frame.
|
||||
Returns the selected frame object. */
|
||||
|
||||
|
Reference in New Issue
Block a user