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.
This commit is contained in:
Phil Muldoon 2010-08-11 20:54:12 +00:00
parent 7346b668d7
commit ca5c20b6d3
6 changed files with 184 additions and 0 deletions

View file

@ -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