Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: gdb/testsuite/gdb.python/py-cmd.exp

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.python/py-breakpoint.exp ('k') | gdb/testsuite/gdb.python/py-events.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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`"
« no previous file with comments | « gdb/testsuite/gdb.python/py-breakpoint.exp ('k') | gdb/testsuite/gdb.python/py-events.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698