aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-03-09 14:22:09 +0000
committerTom Tromey <tromey@redhat.com>2011-03-09 14:22:09 +0000
commiteb8c062170c9e829851bd89f4443e6c5e2f7309d (patch)
tree979d094d7622aa18eb213d0dd1bc3b0b25f097b7 /gdb/thread.c
parenteceb0c5f4943501e17f3296e2348789ccba62522 (diff)
downloadbinutils-eb8c062170c9e829851bd89f4443e6c5e2f7309d.zip
binutils-eb8c062170c9e829851bd89f4443e6c5e2f7309d.tar.gz
binutils-eb8c062170c9e829851bd89f4443e6c5e2f7309d.tar.bz2
* 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/thread.c')
-rw-r--r--gdb/thread.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/thread.c b/gdb/thread.c
index 7d8f6da..b48909f 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -1019,6 +1019,13 @@ restore_selected_frame (struct frame_id a_frame_id, int frame_level)
struct frame_info *frame = NULL;
int count;
+ /* This means there was no selected frame. */
+ if (frame_level == -1)
+ {
+ select_frame (NULL);
+ return;
+ }
+
gdb_assert (frame_level >= 0);
/* Restore by level first, check if the frame id is the same as
@@ -1137,7 +1144,14 @@ make_cleanup_restore_current_thread (void)
&& target_has_registers
&& target_has_stack
&& target_has_memory)
- frame = get_selected_frame (NULL);
+ {
+ /* When processing internal events, there might not be a
+ selected frame. If we naively call get_selected_frame
+ here, then we can end up reading debuginfo for the
+ current frame, but we don't generally need the debuginfo
+ at this point. */
+ frame = get_selected_frame_if_set ();
+ }
else
frame = NULL;