Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: scott snyder <snyder@fnal.gov>
Cc: Arjun Roy <roy.arjun@gmail.com>, gdb@sourceware.org
Subject: Re: Python Scripting Question
Date: Wed, 18 Nov 2009 20:43:00 -0000	[thread overview]
Message-ID: <m3vdhatkxd.fsf@fleche.redhat.com> (raw)
In-Reply-To: <200911122053.nACKrgkk023638@d0mino02.fnal.gov> (scott snyder's 	message of "Thu, 12 Nov 2009 14:53:42 -0600")

>>>>> "scott" == scott snyder <snyder@fnal.gov> writes:

scott> FWIW, i've been using this patch.  This adds a function
scott> `gdb.execute_getoutput', which returns the output as a string.

scott> This probably isn't really the right way to do this ---
scott> I don't think this does the right thing with MI, and it has an ugly
scott> special case for TUI, but it's been working for me so far.

This looks reasonable.  However, I was planning to do it in a different
way.

In particular what I've been thinking is that we'd have a way to let the
user pass any pythonic output stream to gdb; either with explicit
commands to override the current output stream, or as an argument to
gdb.execute.  Handling MI-like output would work in a similar way, just
with a way to indicate that the new output stream is MI-like.

What do you think?  If that is too vague I can try to write up something
more documentation-like.

scott> +  if (uiout == tui_out)
scott> +    uiout = tui_old_uiout;

This sort of redirection probably belongs in a helper function in ui-out.

scott> +  /* Do any commands attached to breakpoint we stopped at.  */
scott> +  bpstat_do_actions ();

This could produce output.  Arguably it should be redirected as well.

Tom


      parent reply	other threads:[~2009-11-16 17:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-08 15:08 Arjun Roy
2009-11-09 17:16 ` Tom Tromey
2009-11-09 17:23   ` Tom Tromey
2009-11-09 17:44     ` Daniel Jacobowitz
2009-11-09 18:12       ` Tom Tromey
2009-11-09 20:22   ` Arjun Roy
2009-11-09 21:12     ` Tom Tromey
2009-11-13 14:36       ` scott snyder
2009-11-13 23:06         ` Arjun Roy
2009-11-18 20:43         ` 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=m3vdhatkxd.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=roy.arjun@gmail.com \
    --cc=snyder@fnal.gov \
    /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