diff options
author | Jason Molenda <jmolenda@apple.com> | 2000-01-18 00:55:13 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2000-01-18 00:55:13 +0000 |
commit | c5394b80aefdea6b2f589723a4b79bcbc1942629 (patch) | |
tree | c53989048ae15966e62006aaee403659bde346bf /gdb/thread.c | |
parent | 67a95c88f38aa938757c92389ba59bbc89e7fa79 (diff) | |
download | gdb-c5394b80aefdea6b2f589723a4b79bcbc1942629.zip gdb-c5394b80aefdea6b2f589723a4b79bcbc1942629.tar.gz gdb-c5394b80aefdea6b2f589723a4b79bcbc1942629.tar.bz2 |
import gdb-2000-01-17 snapshot
Diffstat (limited to 'gdb/thread.c')
-rw-r--r-- | gdb/thread.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/gdb/thread.c b/gdb/thread.c index f4b57af..0ef9a76 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -106,6 +106,7 @@ add_thread (pid) tp->stepping_through_solib_catchpoints = NULL; tp->stepping_through_sigtramp = 0; tp->next = thread_list; + tp->private = NULL; thread_list = tp; return tp; } @@ -602,9 +603,6 @@ thread_command (tidstr, from_tty) char *tidstr; int from_tty; { - int num; - struct thread_info *tp; - if (!tidstr) { /* Don't generate an error, just say which thread is current. */ @@ -621,7 +619,17 @@ thread_command (tidstr, from_tty) error ("No stack."); return; } - num = atoi (tidstr); + + gdb_thread_select (tidstr); +} + +static int +do_captured_thread_select (void *tidstr) +{ + int num; + struct thread_info *tp; + + num = atoi ((char *)tidstr); tp = find_thread_id (num); @@ -634,9 +642,6 @@ see the IDs of currently known threads.", num); switch_to_thread (tp->pid); - if (context_hook) - context_hook (num); - printf_filtered ("[Switching to thread %d (%s)]\n", pid_to_thread_id (inferior_pid), #if defined(HPUXHPPA) @@ -645,7 +650,16 @@ see the IDs of currently known threads.", num); target_pid_to_str (inferior_pid) #endif ); + print_stack_frame (selected_frame, selected_frame_level, 1); + return GDB_RC_OK; +} + +enum gdb_rc +gdb_thread_select (char *tidstr) +{ + return catch_errors (do_captured_thread_select, tidstr, + NULL, RETURN_MASK_ALL); } /* Commands with a prefix of `thread'. */ |