| Index: gdb/testsuite/gdb.python/py-cmd.exp
|
| diff --git a/gdb/testsuite/gdb.python/py-cmd.exp b/gdb/testsuite/gdb.python/py-cmd.exp
|
| index 976adf67ba263b4821feb2e32ccbfa5267d66ecd..36fa343d891c207c2568ef457e11d63e01b54d93 100644
|
| --- a/gdb/testsuite/gdb.python/py-cmd.exp
|
| +++ b/gdb/testsuite/gdb.python/py-cmd.exp
|
| @@ -16,10 +16,6 @@
|
| # This file is part of the GDB testsuite. It tests the mechanism
|
| # for defining new GDB commands in Python.
|
|
|
| -if $tracelevel then {
|
| - strace $tracelevel
|
| -}
|
| -
|
| load_lib gdb-python.exp
|
|
|
| # Start with a fresh gdb.
|
| @@ -142,3 +138,20 @@ gdb_test "python print gdb.string_to_argv ('\"1 2\" 3')" \
|
| gdb_test "python print gdb.string_to_argv ('1\\ 2 3')" \
|
| {\['1 2', '3'\]} \
|
| "string_to_argv ('1\\ 2 3')"
|
| +
|
| +# Test user-defined python commands.
|
| +gdb_py_test_multiple "input simple user-defined command" \
|
| + "python" "" \
|
| + "class test_help (gdb.Command):" "" \
|
| + " \"\"\"Docstring\"\"\"" "" \
|
| + " def __init__ (self):" "" \
|
| + " super (test_help, self).__init__ (\"test_help\", gdb.COMMAND_USER)" "" \
|
| + " def invoke (self, arg, from_tty):" "" \
|
| + " print \"test_cmd output, arg = %s\" % arg" "" \
|
| + "test_help ()" "" \
|
| + "end" ""
|
| +
|
| +gdb_test "test_help ugh" "test_cmd output, arg = ugh" "call simple user-defined command"
|
| +
|
| +# Make sure the command shows up in `help user-defined`.
|
| +gdb_test "help user-defined" "User-defined commands.\[\r\n\]+The commands in this class are those defined by the user.\[\r\n\]+Use the \"define\" command to define a command.\[\r\n\]+\[\r\n\]+List of commands:\[\r\n\]+\[\r\n\]+test_help -- Docstring\[\r\n\]+\[\r\n\]+Type \"help\" followed by command name for full documentation.\[\r\n\]+Type \"apropos word\" to search for commands related to \"word\".\[\r\n\]+Command name abbreviations are allowed if unambiguous.\[\r\n\]+" "see user-defined command in `help user-defined`"
|
|
|