diff options
author | Thiago Jung Bauermann <bauerman@br.ibm.com> | 2011-05-13 04:34:25 +0000 |
---|---|---|
committer | Thiago Jung Bauermann <bauerman@br.ibm.com> | 2011-05-13 04:34:25 +0000 |
commit | 028d0ed5d19d1c164d9ee4f4f85743ca7e955e52 (patch) | |
tree | 971789eee44563ba8452513041730d09151eac1e /gdb/testsuite | |
parent | c9eaa05f39a20ebdd807dcf8141a22e08bb613f1 (diff) | |
download | gdb-028d0ed5d19d1c164d9ee4f4f85743ca7e955e52.zip gdb-028d0ed5d19d1c164d9ee4f4f85743ca7e955e52.tar.gz gdb-028d0ed5d19d1c164d9ee4f4f85743ca7e955e52.tar.bz2 |
gdb/
* mi/mi-main.c (mi_cmd_execute): Use cleanup from
prepare_execute_command.
* top.c (prepare_execute_command): Return cleanup.
(execute_command): Use cleanup from prepare_execute_command.
* top.h (prepare_execute_command): Change prototype to return
cleanup.
* defs.h (struct value): Add opaque declaration.
(make_cleanup_value_free_to_mark): Add prototype.
* utils.c (do_value_free_to_mark): New function.
(make_cleanup_value_free_to_mark): Likewise.
gdb/testsuite/
* gdb.python/py-function.exp: Test setting a value from a function
which executes a command.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-function.exp | 14 |
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." |