diff options
author | Phil Muldoon <pmuldoon@redhat.com> | 2010-08-11 20:54:12 +0000 |
---|---|---|
committer | Phil Muldoon <pmuldoon@redhat.com> | 2010-08-11 20:54:12 +0000 |
commit | ca5c20b6d32018c05a1c20a099a71137b4b27a4d (patch) | |
tree | 482c9088571e90381ebc0739179e47c8e3c0f1f8 /gdb/testsuite | |
parent | 7346b668d73fe13b9b07b805379ff0e03d3aef5e (diff) | |
download | gdb-ca5c20b6d32018c05a1c20a099a71137b4b27a4d.zip gdb-ca5c20b6d32018c05a1c20a099a71137b4b27a4d.tar.gz gdb-ca5c20b6d32018c05a1c20a099a71137b4b27a4d.tar.bz2 |
2010-08-11 Tom Tromey <tromey@redhat.com>
Phil Muldoon <pmuldoon@redhat.com>
* python/python.c (gdbpy_run_events): New function.
(gdbpy_post_event): Likewise.
(gdbpy_initialize_events): Likewise.
(_initialize_python): Call gdbpy_initialize_events.
2010-08-11 Tom Tromey <tromey@redhat.com>
Phil Muldoon <pmuldoon@redhat.com>
* gdb.texinfo (Basic Python): Describe post_event API.
2010-08-11 Phil Muldoon <pmuldoon@redhat.com>
* gdb.python/python.exp (gdb_py_test_multiple): Add gdb.post_event
tests.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/python.exp | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 479e563..e26a138 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-08-11 Phil Muldoon <pmuldoon@redhat.com> + + * gdb.python/python.exp (gdb_py_test_multiple): Add gdb.post_event + tests. + 2010-08-11 Ken Werner <ken.werner@de.ibm.com> * gdb.base/Makefile.in (EXECUTABLES): Add gnu_vector. diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index e153ab8..dc04911 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -120,6 +120,20 @@ gdb_test_no_output \ "python x = gdb.execute('printf \"%d\", 23', to_string = True)" gdb_test "python print x" "23" +# Test post_event. +gdb_py_test_multiple "post event insertion" \ + "python" "" \ + "someVal = 0" "" \ + "class Foo():" "" \ + " def __call__(self):" "" \ + " global someVal" "" \ + " someVal += 1" "" \ + "gdb.post_event(Foo())" "" \ + "end" "" + +gdb_test "python print someVal" "1" "test post event execution" +gdb_test "python gdb.post_event(str(1))" "RuntimeError: Posted event is not callable.*" "Test non callable class" + # Test (no) pagination of the executed command. gdb_test "show height" {Number of lines gdb thinks are in a page is unlimited\.} set lines 10 |