This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: >, >>, and "tee" operators


Does the `transcript FILE' command send both the user input (prompts?)
and output to the file (output also to the console)?  Like unix script?

[Speaking for my patch]

Nope.  Prompts and user input are not logged.  Output goes only to a
file.  Something like `script' might be useful but that's a patch for
another day.
My understanding of a transcript is that it records all details of the exchange - both input and output. Unless the command is recording the input, I don't think it should be called ``transcript''.

The name ``transcript'' came about (I think) from an earlier discussion where a command to record both input and output was proposed. See:
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=114
for its bug report.

> I guess the corresponding ``tee FILE'' command just writes output?


Output goes to the file and to the normal output channel.  Still no
prompts or input.
Ok.

I think there is also a need for a tempoary redirection. So I guess
either the obscure:
	>FILE <command> ...
maybe?
	log FILE <command> .....

How about "transcript FILE <command>"? There's some quoting badness but
for the moment I'm willing to just disallow spaces in the filename. Much more straightforward that way.
(See above for problem I see with the name ``transcript''.)

For whitespace in filenames, see:
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=535
So yes, you get to use strchr (' ') .... :-(

GDB's option identifier is ``/'' and not ``-''. See the print/<FMT>
commands. ``-'' has the problem of being a valid expression operator.
I should note that the current parser is pretty broken. It can't differentiate between:
transcript/f
transcript /f
(sigh) but that is a fixable problem.

GDB's option identifier varies, actually; symbol-file -readnow,
add-symbol-file -s <section> <address> are the only two I see offhand. We only use / for print format characters. Mostly we just drop them
all on one line.

I'd rather stick with '-' as it's more familiar to most of our
audience, particularly with 'tee -a'.
I think this was raised before (fernando and I discussed it somewhere on gdb@). GDB is used on systems that are not even UNIX like (namely DJGPP), trying to tie the syntax to UNIX is such a good idea. GDB needs a syntax spec, the current piece meal aproach is regrettable :-(

If the command was called ``log'' rather than ``tee'' then I don't think we would have problems with ``log -a''. (I'm not saying that log is the right name mind.)

enjoy,
Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]