System notice: In light of the Debian OpenSSL security issue we've regenerated the server keys. See this thread for instructions and the new key fingerprints.

Commit 03ab742942d21da6d69ca11d9ba9b5d7f15f337b

Add get_selected_frame function to gdb module.

Commit diff

gdb/python/frame.c

 
521521}
522522
523523PyObject *
524gdbpy_get_selected_frame (PyObject *self, PyObject *args)
525{
526 struct frame_info *frame;
527 frame_object *frame_obj = NULL; /* Initialize to appease gcc warning. */
528 volatile struct gdb_exception except;
529
530 TRY_CATCH (except, RETURN_MASK_ALL)
531 {
532 frame = get_selected_frame ("No frame is currently selected.");
533 frame_obj = frame_info_to_frame_object (frame);
534 if (frame_obj == NULL)
535 return NULL;
536 }
537 GDB_PY_HANDLE_EXCEPTION (except);
538
539 return (PyObject *) frame_obj;
540}
541
542PyObject *
524543gdbpy_frame_stop_reason_string (PyObject *self, PyObject *args)
525544{
526545 int reason;
toggle raw diff

gdb/python/python-internal.h

 
3838PyObject *gdbpy_current_frame (PyObject *, PyObject *);
3939PyObject *gdbpy_frame_stop_reason_string (PyObject *, PyObject *);
4040PyObject *gdbpy_lookup_symbol (PyObject *self, PyObject *args);
41PyObject *gdbpy_get_selected_frame (PyObject *self, PyObject *args);
4142
4243PyObject *value_from_value (struct value *v);
4344PyObject *variable_to_python (struct cmd_list_element *);
toggle raw diff

gdb/python/python.c

 
7676 "Return a tuple of all frame objects" },
7777 { "current_frame", gdbpy_current_frame, METH_NOARGS,
7878 "Return the current frame object" },
79 { "get_selected_frame", gdbpy_get_selected_frame, METH_NOARGS,
80 "Return the selected frame object" },
7981 { "frame_stop_reason_string", gdbpy_frame_stop_reason_string,
8082 METH_VARARGS, "Return a string explaining unwind stop reason" },
8183
toggle raw diff