From: Daniel Jacobowitz <drow@mvista.com>
To: gdb@sources.redhat.com
Subject: Overriding uiout
Date: Tue, 23 Jul 2002 09:45:00 -0000 [thread overview]
Message-ID: <20020723164601.GA23869@nevyn.them.org> (raw)
There are currently only four code paths in the entire GDB source tree where
uiout could theoretically be overridden to something other than the normal
uiout. They're all for libgdb: gdb_value_struct_elt, gdb_thread_select,
gdb_list_thread_ids, and gdb_breakpoint_query. The only place it actually
appears to be overridden is in gdb_value_struct_elt, which is occasionally
called from varobj code with uiout==NULL. Otherwise it is always overridden
to itself.
This overriding mechanism makes it a bit awkward to redirect GDB's output;
any change to uiout is lost after the current command if we are running from
the prompt (although, surprisingly and IMO inconsistently, it lasts until
the end of a user-defined function).
So I'll ask again - what is this interface supposed to accomplish? If it's
just a step down the road to passing explicit state everywhere, then I think
it's a significant step backwards in other ways, and that we should instead
let clients or wrapper functions manipulate the global state until we're
truly ready to pass a global state around - a global state which can be
overridden for this sort of task.
This is purely a design question, not an implementation objection. For
implementation I'm restricting this feature to CLI only, and implementing it
within cli-out. It turned out to be more elegant than I expected.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
next reply other threads:[~2002-07-23 16:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-23 9:45 Daniel Jacobowitz [this message]
2002-07-23 13:05 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020723164601.GA23869@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox