{"push_id":1297049819,"size":4,"distinct_size":4,"ref":"refs/heads/thread-selected-event-v2","head":"e81d2f700ee3ae1524e192bad80882115f286c89","before":"2181d45e5d91558b184391786bf61190760b94e4","commits":[{"sha":"455c74afacae28efcdf7dd5bf1a5721538308ba1","author":{"name":"Simon Marchi","email":"64f757e6d553be2119779d07ae9f1dc4014e138f@ericsson.com"},"message":"Introduce cleanup to restore current_uiout\n\nMake a globally available cleanup from a pre-existing one in infrun.c.\n\ngdb/ChangeLog:\n\n\t* infrun.c (restore_current_uiout_cleanup): Move to ui-out.c.\n\t(print_stop_event): Use make_cleanup_restore_current_uiout.\n\t* ui-out.c (restore_current_uiout_cleanup): Move from infrun.c.\n\t(make_cleanup_restore_current_uiout): New function definition.\n\t* ui-out.h (make_cleanup_restore_current_uiout): New function\n\tdefinition.","distinct":true,"url":"https://api.github.com/repos/simark/binutils-gdb/commits/455c74afacae28efcdf7dd5bf1a5721538308ba1"},{"sha":"cffee473596039acf47f2dbe76a9fb7ebea6f9f9","author":{"name":"Antoine Tremblay","email":"01a1240f7f05fe4448ff7c0e1e805fd41e1ca377@ericsson.com"},"message":"Send thread, frame and inferior selection events to all uis\n\nWith this patch when a thread, frame or inferior is explicitly selected by\nthe user in the console or mi all uis will be notified.\n\nThis patch fixes PR gdb/20487.\n\nAlso, this patch adds a new field to the =thread-selected event for the\nframe, since inferior/thread/frame are most often a composition, thread and\nframe are sent in the same event.\n\nFront-ends need to handle this new field to properly sync the frame.\n\nHere's a detailed example for each command:\n\n- thread\nFrom console: thread 1.3\nWill generate in the mi channel: =thread-selected,id=\"3\",frame={...}\n\nFrom mi: -thread-select 3\nWill generate in the console: [Switching to thread 1.3 ...\n\nFrom mi: thread 1.3\nWill generate the following mi:\n&\"thread 1.3\\n\"\n~\"#0  child_sub_function () ...\n=thread-selected,id=\"3\",frame={level=\"0\",...}\n^done\n\n- frame\nFrom console: frame 1\nWill generate in the mi channel: =thread-selected,id=\"3\",frame={level=\"1\",...}\n\nFrom mi: -stack-select-frame 1\nWill generate in the console: #1  0x00000000004007f0 in child_function...\n\nFrom mi: frame 1\nWill generate the following mi:\n&\"frame 1\\n\"\n~\"#1  0x00000000004007f9 in ...\"\n=thread-selected,id=\"3\",frame={level=\"1\"...}\n^done\n\n- inferior\n\nFor inferior selection however it only goes from the console to mi as\nthere's no way to select the inferior in mi except with a cli command.\n\n- inferior\nFrom mi: inferior 2\nWill generate the following in mi:\n&\"inferior 2\\n\"\n~\"[Switching to inferior 2 ...\"\n=thread-selected,id=\"4\",frame={level=\"0\"...}\n^done\n\nFrom console: inferior 2\nWill generate in the mi channel: =thread-selected,id=\"3\"\n\nThe test thread-selected-sync.exp also tests the select-frame cli command\nand corner cases of all selection commands.\n\nNote also that this patch makes it possible to suppress notifications\ncaused by a cli command, like was done in mi-interp previously.\n\nThis means that it's now possible to use the add_com_suppress_notification\nfunction to register a command with some event suppressed like is done\nwith the select-frame command in this patch.\n\nNo regressions, tested on ubuntu 14.04 x86.\nWith gdb and native-extented-gdbserver\n\ngdb/ChangeLog:\n\n\tPR gdb/20487\n\t* NEWS: Mention new frame field of =thread-selected event.\n\t* cli/cli-decode.c (add_cmd): Initialize supress_notification.\n\t(add_com_suppress_notification): New function.\n\t(cmd_func): Set the suppress_notification flag and reset it after\n\tcmd->func call.\n\t* cli/cli-decode.h (struct\n\tcmd_list_element)<suppress_notification>: New field.\n\t* cli/cli-interp.c (cli_suppress_notification): Initialize\n\tcli_suppress_notification.\n\t(cli_on_user_selected_inf_thread_frame): New function.\n\t(_initialize_cli_interp): Add user_selected_inf_thread_frame observer.\n\t* command.h (struct cli_suppress_notification): New struct.\n\t(cli_suppress_notification): Struct declaration.\n\t(add_com_suppress_notification): New function.\n\t* defs.h (enum user_selected_what_flag): New enum.\n\t(user_selected_what): New enum flag type.\n\t* frame.h (print_stack_frame_to_uiout): New function.\n\t* gdbthread.h (print_selected_thread_frame): New function declaration.\n\t* inferior.c (print_selected_inferior): New function.\n\t(inferior_command): Remove printing the inferior this is now done\n\tby an event.\n\t(inferior_command): Notify user_selected_inf_thread_frame if the\n\tinferior changed. Let the event print to cli/mi.\n\t* inferior.h (print_selected_inferior): New function declaration.\n\t* mi/mi-cmds.c (struct mi_cmd): Add user_selected_thread_frame\n\tsuppression for stack-select-frame, thread-select command.\n\t* mi/mi-interp.c (struct\n\tmi_suppress_notification)<user_selected_inf_thread_frame>: Init.\n\t(mi_memory_changed): mi_user_selected_inf_thread_frame): New\n\t* function.\n\t(_initialize_mi_interp): Add user_selected_inf_thread_frame observer.\n\t* mi/mi-main.c (mi_cmd_thread_select): Print thread selection response.\n\t(mi_execute_command): Don't report thread change on\n\tthread or inferior cli commands, notify if the thread changes.\n\t* mi/mi-main.h (struct\n\tmi_suppress_notification)<user_selected_inf_thread_frame>: New field.\n\t* stack.c: include \"observer.h\".\n\t(print_stack_frame_to_uiout): New function.\n\t(select_frame_command): Notify user_selected_inf_thread_frame.\n\t(frame_command): Use print_selected_thread_frame if there's no\n\tchange or notify if there is one.\n\t(up_command): Notify user_selected_inf_thread_frame.\n\t(down_command): Likewise.\n\t(_initialize_stack): Suppress event in cli for command\n\tselect-frame.\n\t* thread.c (thread_command): Print if thread has not changed.\n\t(do_captured_thread_select): Let mi_cmd_thread_select print.\n\t(print_selected_thread_frame): New function.\n\t* tui/tui-interp.c (tui_on_user_selected_inf_thread_frame):\n\tNew function.\n\t(_initialize_tui_interp): Add user_selected_inf_thread_frame observer.\n\ngdb/doc/ChangeLog:\n\n\tPR gdb/20487\n\t* observer.texi (user_selected_inf_thread_frame): New function.\n\ngdb/testsuite/ChangeLog:\n\n\tPR gdb/20487\n\t* gdb.mi/thread-selected-sync.c: New file.\n\t* gdb.mi/thread-selected-sync.exp: Likewise.\n\t* gdb.mi/mi-pthreads.exp(check_mi_thread_command_set): Adapt\n\t=thread-select-event check.","distinct":true,"url":"https://api.github.com/repos/simark/binutils-gdb/commits/cffee473596039acf47f2dbe76a9fb7ebea6f9f9"},{"sha":"3697f688ba10177a477aec60f9b81fbbe7e5c375","author":{"name":"Simon Marchi","email":"64f757e6d553be2119779d07ae9f1dc4014e138f@ericsson.com"},"message":"Add test for user context selection sync\n\nThis patch adds a test to verify that events are sent properly to all\nUIs when the user selection context (inferior, thread, frame) changes.","distinct":true,"url":"https://api.github.com/repos/simark/binutils-gdb/commits/3697f688ba10177a477aec60f9b81fbbe7e5c375"},{"sha":"e81d2f700ee3ae1524e192bad80882115f286c89","author":{"name":"Simon Marchi","email":"64f757e6d553be2119779d07ae9f1dc4014e138f@ericsson.com"},"message":"make_null_cleanup","distinct":true,"url":"https://api.github.com/repos/simark/binutils-gdb/commits/e81d2f700ee3ae1524e192bad80882115f286c89"}]}
{"actor":{"display_login":"simark"}}