Daniel Jacobowitz wrote about some Python/GDB experiences and bugs in the email: http://sourceware.org/ml/archer/2009-q4/msg00008.html This bug (and others in their own bugs) is extracted from that email to track the issue: * It would be really useful to temporarily redirect GDB output to a memory buffer, i.e. a version of gdb.execute that captured the command's output. Especially where there aren't specific Python bindings for what I wanted.
Testing a patch.
Subject: Bug 10808 CVSROOT: /cvs/src Module name: src Changes by: tromey@sourceware.org 2010-06-25 18:15:21 Modified files: gdb : ChangeLog gdb/doc : ChangeLog gdb.texinfo gdb/python : python.c gdb/testsuite : ChangeLog gdb/testsuite/gdb.python: python.exp Log message: gdb PR python/10808: * python/python.c (execute_gdb_command): Add keywords. Accept "to_string" argument. (struct restore_ui_file_closure): New. (restore_ui_file): New function. (make_cleanup_restore_ui_file): Likewise. (GdbMethods) <execute>: Update. gdb/doc PR python/10808: * gdb.texinfo (Basic Python): Document new gdb.execute argument. gdb/testsuite PR python/10808: * gdb.python/python.exp: Add new tests. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.11931&r2=1.11932 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/doc/ChangeLog.diff?cvsroot=src&r1=1.1076&r2=1.1077 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/doc/gdb.texinfo.diff?cvsroot=src&r1=1.730&r2=1.731 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/python/python.c.diff?cvsroot=src&r1=1.42&r2=1.43 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2352&r2=1.2353 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/python.exp.diff?cvsroot=src&r1=1.8&r2=1.9
Fix checked in.