summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/dprintf.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/dprintf.exp')
-rw-r--r--gdb/testsuite/gdb.base/dprintf.exp24
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/dprintf.exp b/gdb/testsuite/gdb.base/dprintf.exp
index 6d1ce6c79bf..1e9d017bb73 100644
--- a/gdb/testsuite/gdb.base/dprintf.exp
+++ b/gdb/testsuite/gdb.base/dprintf.exp
@@ -85,6 +85,30 @@ if ![target_info exists gdb,noinferiorio] {
"2nd dprintf, fprintf"
}
+set target_can_dprintf 1
+set msg "Set dprintf style to agent"
+gdb_test_multiple "set dprintf-style agent" $msg {
+ -re "warning: Target cannot run dprintf commands.*" {
+ set target_can_dprintf 0
+ pass "$msg - cannot do"
+ }
+ -re ".*$gdb_prompt $" {
+ pass "$msg - can do"
+ }
+}
+
+if $target_can_dprintf {
+
+ gdb_run_cmd
+
+ gdb_test "" "Breakpoint"
+
+ gdb_test "continue" "Breakpoint \[0-9\]+, foo .*" "1st dprintf, agent"
+
+ gdb_test "continue" "Breakpoint \[0-9\]+, foo .*" "2nd dprintf, agent"
+
+}
+
gdb_test "set dprintf-style foobar" "Undefined item: \"foobar\"." \
"Set dprintf style to an unrecognized type"