[this is more than just a cli issue, but figured it's as good a component as any] This pr was triggered by this code in infrun.c: if (cmd_done && !was_sync && exec_done_display_p && (ptid_equal (inferior_ptid, null_ptid) || !is_running (inferior_ptid))) printf_unfiltered (_("completed.\n")); Why printf_unfiltered? At the least it would be good to add some docs somewhere (internals manual? utils.[ch]?) guidelines for when to use one or the other. That reminded me of another issue. We go to some lengths to make sure we've done target_terminal_ours_for_output before we print something (in cases where the terminal might be owned by the inferior), but we don't make any similar effort for debugging output (nor should we, at least in the general case). But it's not clear to me what the consequences of this, if any, are. We should get that documented somewhere. And if there are no consequences, let's still get that documented. [And if it is already documented, awesome. I skimmed utils.[ch] and the wiki and didn't find anything.]
infcmd.c:signal_command is another example of an odd mix of printf_filtered and printf_unfiltered: if (!non_stop) { struct thread_info *tp; ptid_t resume_ptid; int must_confirm = 0; /* This indicates what will be resumed. Either a single thread, a whole process, or all threads of all processes. */ resume_ptid = user_visible_resume_ptid (0); ALL_NON_EXITED_THREADS (tp) { if (ptid_equal (tp->ptid, inferior_ptid)) continue; if (!ptid_match (tp->ptid, resume_ptid)) continue; if (tp->suspend.stop_signal != GDB_SIGNAL_0 && signal_pass_state (tp->suspend.stop_signal)) { if (!must_confirm) printf_unfiltered (_("Note:\n")); printf_unfiltered (_(" Thread %d previously stopped with signal %s, %s.\n"), tp->num, gdb_signal_to_name (tp->suspend.stop_signal), gdb_signal_to_string (tp->suspend.stop_signal)); must_confirm = 1; } } if (must_confirm && !query (_("Continuing thread %d (the current thread) with specified signal will\n" "still deliver the signals noted above to their respective threads.\n" "Continue anyway? "), inferior_thread ()->num)) error (_("Not confirmed.")); } if (from_tty) { if (oursig == GDB_SIGNAL_0) printf_filtered (_("Continuing with no signal.\n")); else printf_filtered (_("Continuing with signal %s.\n"), gdb_signal_to_name (oursig)); }
See also bug #7234. That one implies that gdb_stdout should be filtered and the rest unfiltered. I tend to think that all unfiltered output should be removed. For one thing if there is ever a mix of filtered and unfiltered, then paging confusion could result, because it seems like gdb would end up with an incorrect line count.
Let's discuss the pager in bug #7234. *** This bug has been marked as a duplicate of bug 7234 ***