Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: "Mathew Yeates" <mat.yeates@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: capturing command output to a variable
Date: Sun, 11 Jan 2009 22:38:00 -0000	[thread overview]
Message-ID: <m3mydxv595.fsf@fleche.redhat.com> (raw)
In-Reply-To: <7d0c05ac0901111323u61269393vcf0c2f5fb3b5b955@mail.gmail.com> (Mathew Yeates's message of "Sun\, 11 Jan 2009 13\:23\:01 -0800")

>>>>> "Mathew" == Mathew Yeates <mat.yeates@gmail.com> writes:

Mathew> I understand that turning on logging will allow me to save command
Mathew> output to a file. But what if I want to save the output in a
Mathew> convenience variable??

As far as I know, with cvs gdb this can only be done with difficulty.

For example, you could log the output of the command to a file, then
use 'shell' to run sed on the file to turn it into a gdb command which
sets the convenience variable, and then finally 'source' the result.

The Python integration will make this sort of thing much simpler,
though it occurs to me that we haven't done full I/O integration yet,
so this example remains difficult there.  (I do have most of a patch
to add ui-file wrappers to Python... I guess I ought to finish that.)

Tom


      reply	other threads:[~2009-01-11 22:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-11 21:23 Mathew Yeates
2009-01-11 22:38 ` Tom Tromey [this message]

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=m3mydxv595.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=mat.yeates@gmail.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