public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Paul Bolle <pebolle@tiscali.nl>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Fix uiout for execute_command_to_string
Date: Sat, 04 Sep 2010 15:36:00 -0000	[thread overview]
Message-ID: <1283551592.3230.27.camel@localhost.localdomain> (raw)
In-Reply-To: <20100903180619.GA15409@host1.dyn.jankratochvil.net>

On Fri, 2010-09-03 at 20:06 +0200, Jan Kratochvil wrote: 
> Redirected there also gdb_stdlog as it seems appropriate to me.  That is
> remain unredirected gdb_stdin, gdb_stdtargin, gdb_stdtarg and gdb_stdtargerr,
> I do not much understand gdb_stdtarg* but it seems to +/- match other
> redirections in GDB.

It seems I need the (trivial) patch below (to be applied on your recent
work) to also get the output from remote commands invoked by the python
command redirected to a string. Example:

    foo = gdb.execute("monitor foo", to_string=True)

I can't recall exactly why this is needed. (It's about a week ago that I
noticed this, while trying to understand
https://bugzilla.redhat.com/show_bug.cgi?id=627506 ).



Paul
---
diff -up gdb-7.1.90.20100806/gdb/top.c.gdbstdt_arg gdb-7.1.90.20100806/gdb/top.c
--- gdb-7.1.90.20100806/gdb/top.c.gdbstdt_arg	2010-09-03 23:01:23.000000000 +0200
+++ gdb-7.1.90.20100806/gdb/top.c	2010-09-03 23:25:12.000000000 +0200
@@ -480,6 +480,7 @@ execute_command_to_string (char *p, int 
   make_cleanup_restore_ui_file (&gdb_stdout);
   make_cleanup_restore_ui_file (&gdb_stderr);
   make_cleanup_restore_ui_file (&gdb_stdlog);
+  make_cleanup_restore_ui_file (&gdb_stdtarg);
 
   if (ui_out_redirect (uiout, str_file) < 0)
     warning (_("Current output protocol does not support redirection"));
@@ -489,6 +490,7 @@ execute_command_to_string (char *p, int 
   gdb_stdout = str_file;
   gdb_stderr = str_file;
   gdb_stdlog = str_file;
+  gdb_stdtarg = str_file;
 
   execute_command (p, from_tty);
 


  reply	other threads:[~2010-09-03 22:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-03 20:03 Jan Kratochvil
2010-09-04 15:36 ` Paul Bolle [this message]
2010-09-10 13:02   ` Jan Kratochvil
2010-09-10 22:05     ` Tom Tromey
2010-09-11 18:34       ` Jan Kratochvil

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=1283551592.3230.27.camel@localhost.localdomain \
    --to=pebolle@tiscali.nl \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).