Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@transmeta.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-patches@sources.redhat.com
Subject: RFC: Syntax for logging
Date: Sat, 21 Jun 2003 18:01:00 -0000	[thread overview]
Message-ID: <16116.40297.515332.184602@casey.transmeta.com> (raw)
In-Reply-To: <20030621172358.GA8711@nevyn.them.org>

Daniel Jacobowitz writes:
 > Folks may remember the thread from a year ago:
 >   RFA: >, >>, and "tee" operators
 >   http://sources.redhat.com/ml/gdb-patches/2002-07/msg00458.html
 > 
 > I eventually decided that my prefered syntax was:
 >   redirect [-a] [FILE [COMMAND]]
 >   log [-a] [FILE [COMMAND]]
 > But people didn't care for the use of "-a".  I still like this syntax; it's
 > symmetric, and it allows clearly "transcript [-a]".  But it's pretty clear
 > to me that we won't reach a consensus on that.  I believe Fernando liked it
 > and Andrew didn't.
 > 
 > I believe the best alternative at this point is:
 >  set logging [redirect|log] [append|overwrite] FILE
 >  show logging
 > The defaults would be log,overwrite; they could be explicitly specified in
 > order to overwrite a log file named append, if one wanted to do that.
 > 
 > Comments, anyone?  Shall I repost the patch with that change?  I'd really
 > like to see this feature added.

There's one useful piece of functionality that isn't in "set logging".
Suppose I want to do a one-off command without disturbing the current setting?

This is an inherent problem in all set/show commands.
If one could have a version of show commands that outputted a value
that is an acceptable argument to the set command, and if one
has a facility to capture the output of commands and record them
in variables, then one would have a general solution, but that's
a bit of work (but not that much work ;-).

In pseudo-gdb code:

set $foo $`show -for-set logging`
set logging new-value
mumble
set logging $foo

fwiw, I don't think you should add a logging facility until
you know how you're going to solve the one-off request.
One don't have to solve it right away, but one should at least
have thought about it.
It needn't be solved by something so grandiose of course.
This is where redirect/log have an advantage though
I'm guessing one could come up with something simple that
allowed one-off's with "set logging".


  reply	other threads:[~2003-06-21 18:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-21 17:24 Daniel Jacobowitz
2003-06-21 18:01 ` Doug Evans [this message]
2003-06-22 18:04 ` Andrew Cagney
2003-06-22 18:07   ` Daniel Jacobowitz
2003-06-22 18:32     ` Andrew Cagney
2003-06-22 18:41       ` Daniel Jacobowitz
2003-06-22 19:19         ` Daniel Jacobowitz

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=16116.40297.515332.184602@casey.transmeta.com \
    --to=dje@transmeta.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@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