summaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-03-09 14:22:06 +0000
committerTom Tromey <tromey@redhat.com>2011-03-09 14:22:06 +0000
commit029fb512f2fd983b7084a7278d2b1a3ff35c054e (patch)
treeac84f82d5312240924145b8ce0e2b19eba1b6714 /gdb/frame.c
parent142db50201b1b1c69ebdc2dcdb1181cde1db3b08 (diff)
downloadgdb-029fb512f2fd983b7084a7278d2b1a3ff35c054e.tar.gz
* thread.c (restore_selected_frame): Handle frame_level == -1.
(make_cleanup_restore_current_thread): Use get_selected_frame_if_set. * frame.h (get_selected_frame_if_set): Declare. * frame.c (get_selected_frame_if_set): New function.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index 36fcefe6f7b..bf3ce77ba7e 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1247,6 +1247,14 @@ get_selected_frame (const char *message)
return selected_frame;
}
+/* If there is a selected frame, return it. Otherwise, return NULL. */
+
+struct frame_info *
+get_selected_frame_if_set (void)
+{
+ return selected_frame;
+}
+
/* This is a variant of get_selected_frame() which can be called when
the inferior does not have a frame; in that case it will return
NULL instead of calling error(). */