diff options
author | Phil Muldoon <pmuldoon@redhat.com> | 2011-03-18 08:44:47 +0000 |
---|---|---|
committer | Phil Muldoon <pmuldoon@redhat.com> | 2011-03-18 08:44:47 +0000 |
commit | 99c3dc11e424a5f6cc9749fabd34f8c0d80cac9f (patch) | |
tree | 19df7ea1eadefc9afc0a06fe63720c751a35b4dd /gdb/testsuite | |
parent | c20800befe98654599697c9bae2a69359ef5d0d0 (diff) | |
download | gdb-99c3dc11e424a5f6cc9749fabd34f8c0d80cac9f.zip gdb-99c3dc11e424a5f6cc9749fabd34f8c0d80cac9f.tar.gz gdb-99c3dc11e424a5f6cc9749fabd34f8c0d80cac9f.tar.bz2 |
2011-03-18 Phil Muldoon <pmuldoon@redhat.com>
PR python/12149
* python/python.c (gdbpy_write): Accept a stream argument and
operate to the appropriate stream.
(gdbpy_flush): Likewise.
(_initialize_python): Add stream constants.
(finish_python_initialization): Add GdbOutputErrorFile class.
2011-03-18 Phil Muldoon <pmuldoon@redhat.com>
PR python/12149
* gdb.texinfo (Basic Python): Update gdb.write and flush text.
2011-03-18 Phil Muldoon <pmuldoon@redhat.com>
PR python/12149
* gdb.python/python.exp: Add gdb.write tests.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/python.exp | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index ded9d94..a1f1382 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2011-03-18 Phil Muldoon <pmuldoon@redhat.com> + + PR python/12149 + + * gdb.python/python.exp: Add gdb.write tests. + 2010-03-17 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/Makefile.in: Add py-objfile. diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index ece77ca..a68dd24 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -170,3 +170,11 @@ gdb_test "python print len(symtab)" "2" "Test decode_line func1 length" gdb_test "python print len(symtab\[1\])" "1" "Test decode_line func1 length" gdb_test "python print symtab\[1\]\[0\].symtab" "gdb/testsuite/gdb.python/python-1.c.*" "Test decode_line func1 filename" gdb_test "python print symtab\[1\]\[0\].line" "19" "Test decode_line func1 line number" + +# gdb.write +gdb_test "python print sys.stderr" ".*__main__.GdbOutputErrorFile instance at.*" "Test stderr location" +gdb_test "python print sys.stdout" ".*__main__.GdbOutputFile instance at.*" "Test stdout location" +gdb_test "python gdb.write(\"Foo\\n\")" "Foo" "Test default write" +gdb_test "python gdb.write(\"Error stream\\n\", stream=gdb.STDERR)" "Error stream" "Test stderr write" +gdb_test "python gdb.write(\"Normal stream\\n\", stream=gdb.STDOUT)" "Normal stream" "Test stdout write" +gdb_test "python gdb.write(\"Log stream\\n\", stream=gdb.STDLOG)" "Log stream" "Test stdlog write" |