From: Paul Dubuc <pdubuc@cas.org>
To: tromey@redhat.com
Cc: Orjan Friberg <orjan.friberg@axis.com>,
Grant Edwards <grante@visi.com>,
gdb@sourceware.cygnus.com
Subject: Re: Redirect GDB command output?
Date: Fri, 05 Oct 2001 11:44:00 -0000 [thread overview]
Message-ID: <3BBDFF99.B9F3FA85@cas.org> (raw)
In-Reply-To: <87vghuszgw.fsf@creche.redhat.com>
Tom Tromey wrote:
>
> >>>>> "Paul" == Paul Dubuc <pdubuc@cas.org> writes:
>
> Paul> No, I was looking for something more like the redirect
> Paul> capability for the output of individual commands from the gdb
> Paul> prompt. Some dbx functions our project uses rely on this
> Paul> capability in dbx and (unfortunately) I see no way of
> Paul> reproducing those functions with gdb user-defined commands.
>
> I don't think it would be very hard to write `>' (redirect) and `>>'
> (redirect-append) commands for gdb. Maybe you could even have a `|'
> command that would pipe output through another process (this might be
> harder due to portability constraints).
>
> The easiest way to do this would be to have prefix commands. For
> instance `> file command' would run command with output redirected to
> file. `> file' would redirect output for all subsequence command
> lines. Plain `>' would then stop redirecting the output.
>
> Likewise for `>>'. Something like `|' would probably need a slightly
> different syntax (for instance simply disallow a trailing gdb
> command).
>
> Using a prefix command feels a bit strange, but I implementation-wise
> is probaby much, much easier.
>
> Tom
Thanks for the suggestion, Tom.
It would feel strange to do it this way. Sun's dbx implements functions
and
aliases as extenstions to ksh. I like this because it's familiar, but
there
are portability constraints with gdb, I know. Something that might work
just
as well is a new command 'redirect' that would just redirect all command
output
to a file that you specify (possibly with the option of 'tee'ing it
there
instead of redirecting completely) until 'redirect' is called again to
change the destination. Would this be any easier to implement?
--
Paul M. Dubuc pdubuc@cas.org
next prev parent reply other threads:[~2001-10-05 11:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-03 12:02 Paul Dubuc
2001-10-05 7:23 ` Grant Edwards
2001-10-05 8:12 ` Orjan Friberg
2001-10-05 8:47 ` Grant Edwards
2001-10-05 9:34 ` Paul Dubuc
2001-10-05 11:27 ` Tom Tromey
2001-10-05 11:44 ` Paul Dubuc [this message]
2001-10-09 21:56 ` 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=3BBDFF99.B9F3FA85@cas.org \
--to=pdubuc@cas.org \
--cc=gdb@sourceware.cygnus.com \
--cc=grante@visi.com \
--cc=orjan.friberg@axis.com \
--cc=tromey@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