aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.python/py-function.exp14
2 files changed, 19 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 9231ae2..f6ad357 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-13 Thiago Jung Bauermann <bauerman@br.ibm.com>
+
+ * gdb.python/py-function.exp: Test setting a value from a function
+ which executes a command.
+
2011-05-12 Tom Tromey <tromey@redhat.com>
* gdb.dwarf2/typeddwarf.S: New file.
diff --git a/gdb/testsuite/gdb.python/py-function.exp b/gdb/testsuite/gdb.python/py-function.exp
index dfccdff..ffadb5b 100644
--- a/gdb/testsuite/gdb.python/py-function.exp
+++ b/gdb/testsuite/gdb.python/py-function.exp
@@ -95,3 +95,17 @@ gdb_py_test_multiple "Test Normal Error" \
gdb_test "print \$normalerror()" "Traceback.*File.*line 5.*in invoke.*RuntimeError.*This is a Normal Error.*" \
"Test a Runtime error. There should be a stack trace."
+
+gdb_py_test_multiple "input command-calling function" \
+ "python" "" \
+ "class CallCommand(gdb.Function):" "" \
+ " def __init__(self):" "" \
+ " gdb.Function.__init__(self, 'call_command')" "" \
+ " def invoke(self):" "" \
+ " return gdb.execute('print 1', to_string=True)" "" \
+ "CallCommand ()" "" \
+ "end" ""
+
+gdb_test_no_output "set var \$foo = \$call_command()" "Setting a value from a function which executes a command."
+# There was a bug where GDB would segfault in the second call, so try calling again.
+gdb_test_no_output "set var \$foo = \$call_command()" "Setting a value from a function which executes a command, again."