This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 4/4] Test case on setting dprintf commands.


Test that GDB doesn't allow setting commands for dprintf breakpoint.

gdb/testsuite:

2013-02-28  Yao Qi  <yao@codesourcery.com>

	* gdb.base/dprintf.exp: Test commands are not allowed to set
	for dprintf breakpoint.
---
 gdb/testsuite/gdb.base/dprintf.exp |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/gdb/testsuite/gdb.base/dprintf.exp b/gdb/testsuite/gdb.base/dprintf.exp
index 22c740a..aa0108d 100644
--- a/gdb/testsuite/gdb.base/dprintf.exp
+++ b/gdb/testsuite/gdb.base/dprintf.exp
@@ -40,6 +40,20 @@ gdb_breakpoint "main"
 gdb_test "dprintf foo,\"At foo entry\\n\"" \
   "Dprintf .*"
 
+# Test that GDB doesn't allow setting commands for dprintf.
+set test "set commands for dprintf"
+gdb_test_multiple "commands \$bpnum" "${test}" {
+    -re "End with a line saying just \"end\".*>" {
+	send_gdb "silent\n"
+	send_gdb "end\n"
+
+	fail $test
+    }
+    -re "Setting commands for dprintf breakpoint is not allowed.*\r\n$gdb_prompt $" {
+	pass $test
+    }
+}
+
 # Set two dprintf breakpoints at the same location.
 gdb_test "dprintf $dp_location1,\"arg=%d, g=%d\\n\", arg, g" \
     "Dprintf .*"
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]