Hi all, TUI mode when debugging a remote target got broken after the recent selected frame changes. After connecting to the target (target remote ...) Issuing a continue results in: (gdb) c Continuing. Remote communication error: Software caused connection abort. And a snippet of a set debug remote session: (...) Packet vCont (verbose-resume) is supported Sending packet: $vCont;c#a8...Ack Packet received: W00 Sending packet: $g#67...Remote communication error: Software caused connection abort. (gdb) c Continuing. gdb is sending a g packet after a W. Something in gdb didn't realize that the the target already exited. The problem is that we now call deprecated_safe_get_selected_frame in tui_selected_frame_level_changed_hook... : static void tui_selected_frame_level_changed_hook (int level) { struct frame_info *fi; fi = deprecated_safe_get_selected_frame (); /* Ensure that symbols for this frame are read in. Also, determine the source language of this frame, and switch to it if desired. */ if (fi) { struct symtab *s; s = find_pc_symtab (get_frame_pc (fi)); (...) ... and the deprecated_safe_get_selected_frame is not realizing the target is not running anymore, so calls get_selected_frame, which ensures that there is always a frame selected. Then in tui_selected_frame_level_changed_hook, the get_frame_pc is called, which ends up trying to talk to the remote target, but at this point the stub is not reachable anymore, hence the Remote communication error. The way deprecated_safe_get_selected_frame checks to see if there is a selectable frame is: struct frame_info * deprecated_safe_get_selected_frame (void) { if (!target_has_registers || !target_has_stack || !target_has_memory) return NULL; return get_selected_frame (NULL); } When using a remote target the following test is not true on when the 'W' packet arrives: if (!target_has_registers || !target_has_stack || !target_has_memory) The attached patch fixes it by calling target_mark_running, and target_mark_exited in remote.c. These functions set those target_has_* to 0 and 1 appropriately. They are currently only used on remote-sim.c. Let me know if there is a better way to know if the target is running. tui_registers_changed_hook then has the problem that is is calling get_selected_frame, when target_has_registers is false. Fixed by using deprecated_safe_get_selected_frame here too. Note that I still see a TUI slow repainting problem introduced by the selected frame changes. I haven't investigated that yet. Cheers, Pedro Alves