From dfa2726f54d0007bcbcc70d63d49d93a9272e367 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 2 May 2004 00:21:41 +0000 Subject: 2004-05-01 Andrew Cagney * breakpoint.c (insert_bp_location): Use get_frame_id, and frame_find_by_id instead of frame_relative_level. (do_enable_breakpoint): Ditto. * thread.c: Update copyright. (info_threads_command): Ditto, simplify. --- gdb/thread.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'gdb/thread.c') diff --git a/gdb/thread.c b/gdb/thread.c index b8a7f8bfc51..35ba2b14a16 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -1,7 +1,7 @@ /* Multi-process/thread control for GDB, the GNU debugger. Copyright 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA. @@ -417,15 +417,9 @@ info_threads_command (char *arg, int from_tty) struct thread_info *tp; ptid_t current_ptid; struct frame_info *cur_frame; - int saved_frame_level = frame_relative_level (get_selected_frame ()); - int counter; + struct frame_id saved_frame_id = get_frame_id (get_selected_frame ()); char *extra_info; - /* Check that there really is a frame. This happens when a simulator - is connected but not loaded or running, for instance. */ - if (legacy_frame_p (current_gdbarch) && saved_frame_level < 0) - error ("No frame."); - prune_threads (); target_find_new_threads (); current_ptid = inferior_ptid; @@ -453,27 +447,23 @@ info_threads_command (char *arg, int from_tty) switch_to_thread (current_ptid); - /* Code below copied from "up_silently_base" in "stack.c". - * It restores the frame set by the user before the "info threads" - * command. We have finished the info-threads display by switching - * back to the current thread. That switch has put us at the top - * of the stack (leaf frame). - */ - counter = saved_frame_level; - cur_frame = find_relative_frame (get_selected_frame (), &counter); - if (counter != 0) + /* Restores the frame set by the user before the "info threads" + command. We have finished the info-threads display by switching + back to the current thread. That switch has put us at the top of + the stack (leaf frame). */ + cur_frame = frame_find_by_id (saved_frame_id); + if (cur_frame == NULL) { - /* Ooops, can't restore, tell user where we are. */ + /* Ooops, can't restore, tell user where we are. */ warning ("Couldn't restore frame in current thread, at frame 0"); print_stack_frame (get_selected_frame (), 0, LOCATION); } else { select_frame (cur_frame); + /* re-show current frame. */ + show_stack_frame (cur_frame); } - - /* re-show current frame. */ - show_stack_frame (cur_frame); } /* Switch from one thread to another. */ -- cgit v1.2.1