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.
This commit is contained in:
Tom Tromey 2010-06-25 18:15:18 +00:00
parent 099ef718e3
commit bc9f0842f1
6 changed files with 103 additions and 10 deletions

View file

@ -83,3 +83,7 @@ gdb_test "python print gdb.objfiles()" "\\\[\\\]"
# Test http://bugs.python.org/issue4434 workaround in configure.ac
gdb_test "python import itertools; print 'IMPOR'+'TED'" "IMPORTED" "pythonX.Y/lib-dynload/*.so"
gdb_test_no_output \
"python x = gdb.execute('printf \"%d\", 23', to_string = True)"
gdb_test "python print x" "23"