public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/17222] New: printf_filtered vs printf_unfiltered
@ 2014-08-01 16:58 dje at google dot com
  2014-08-31 22:11 ` [Bug cli/17222] " xdje42 at gmail dot com
  2021-12-27  6:31 ` tromey at sourceware dot org
  0 siblings, 2 replies; 3+ messages in thread
From: dje at google dot com @ 2014-08-01 16:58 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17222

            Bug ID: 17222
           Summary: printf_filtered vs printf_unfiltered
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: minor
          Priority: P2
         Component: cli
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com

[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.]

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug cli/17222] printf_filtered vs printf_unfiltered
  2014-08-01 16:58 [Bug cli/17222] New: printf_filtered vs printf_unfiltered dje at google dot com
@ 2014-08-31 22:11 ` xdje42 at gmail dot com
  2021-12-27  6:31 ` tromey at sourceware dot org
  1 sibling, 0 replies; 3+ messages in thread
From: xdje42 at gmail dot com @ 2014-08-31 22:11 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17222

Doug Evans <xdje42 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xdje42 at gmail dot com

--- Comment #1 from Doug Evans <xdje42 at gmail dot com> ---
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));
    }

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug cli/17222] printf_filtered vs printf_unfiltered
  2014-08-01 16:58 [Bug cli/17222] New: printf_filtered vs printf_unfiltered dje at google dot com
  2014-08-31 22:11 ` [Bug cli/17222] " xdje42 at gmail dot com
@ 2021-12-27  6:31 ` tromey at sourceware dot org
  1 sibling, 0 replies; 3+ messages in thread
From: tromey at sourceware dot org @ 2021-12-27  6:31 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17222

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
Let's discuss the pager in bug #7234.

*** This bug has been marked as a duplicate of bug 7234 ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-27  6:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-01 16:58 [Bug cli/17222] New: printf_filtered vs printf_unfiltered dje at google dot com
2014-08-31 22:11 ` [Bug cli/17222] " xdje42 at gmail dot com
2021-12-27  6:31 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).