From: Keith Seitz Date: Wed, 28 Aug 2002 16:55:55 +0000 (+0000) Subject: * thread.c (do_captured_thread_select): Add context-changed X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2227a2f94ecfc365b9a0c32ef9407d2b30251b4f;p=thirdparty%2Fbinutils-gdb.git * thread.c (do_captured_thread_select): Add context-changed notification. * infrun.c (handle_inferior_event): Remove context-changed notification. The stop result already has this information. * thread.c (do_captured_list_thread_ids): Use ui_out_list_begin/end instead of ui_out_tuple_begin/end. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ecf5c991984..6d1f478a165 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2002-08-28 Keith Seitz + + * thread.c (do_captured_thread_select): Add context-changed + notification. + * infrun.c (handle_inferior_event): Remove context-changed + notification. The stop result already has this information. + + * thread.c (do_captured_list_thread_ids): Use ui_out_list_begin/end + instead of ui_out_tuple_begin/end. + 2002-08-22 Keith Seitz * breakpoint.c (internal_breakpoint_number): Revert 2002-06-18 change. diff --git a/gdb/infrun.c b/gdb/infrun.c index dc387cddd55..672d5f93c65 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1947,7 +1947,6 @@ handle_inferior_event (struct execution_control_state *ecs) context_switch (ecs); - context_changed_event (pid_to_thread_id (ecs->ptid)); if (context_hook) context_hook (pid_to_thread_id (ecs->ptid)); diff --git a/gdb/thread.c b/gdb/thread.c index fa5eb27b15c..b050682450f 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -262,7 +262,7 @@ do_captured_list_thread_ids (struct ui_out *uiout, struct thread_info *tp; int num = 0; - ui_out_tuple_begin (uiout, "thread-ids"); + ui_out_list_begin (uiout, "thread-ids"); for (tp = thread_list; tp; tp = tp->next) { @@ -270,7 +270,7 @@ do_captured_list_thread_ids (struct ui_out *uiout, ui_out_field_int (uiout, "thread-id", tp->num); } - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); ui_out_field_int (uiout, "number-of-threads", num); return GDB_RC_OK; } @@ -690,10 +690,12 @@ do_captured_thread_select (struct ui_out *uiout, void *tidstr) { int num; + ptid_t old_ptid; struct thread_info *tp; num = value_as_long (parse_and_eval (tidstr)); + old_ptid = inferior_ptid; tp = find_thread_id (num); if (!tp) @@ -715,6 +717,10 @@ do_captured_thread_select (struct ui_out *uiout, ui_out_text (uiout, ")]"); print_stack_frame (selected_frame, frame_relative_level (selected_frame), 1); + + if (!ptid_equal (old_ptid, inferior_ptid)) + context_changed_event (pid_to_thread_id (inferior_ptid)); + return GDB_RC_OK; }