-# Copyright (C) 2012-2020 Free Software Foundation, Inc.
+# Copyright (C) 2012-2024 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
standard_testfile
-if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
+set flags {}
+lappend flags debug
+lappend_include_file flags $srcdir/lib/unbuffer_output.c
+
+if { [prepare_for_testing "failed to prepare" $testfile $srcfile $flags] } {
return -1
}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
set dp_location1 [gdb_get_line_number "set dprintf 1 here"]
-if ![runto main] {
+if ![runto_main] {
return -1
}
clean_restart $binfile
- if ![runto main] {
+ if ![runto_main] {
return -1
}
test_dprintf "At foo entry.*arg=1235, g=2222\r\n" "2nd dprintf"
}
+ gdb_test_multiple "print stderr" "stderr symbol check" {
+ -re "\\'stderr\\' has unknown type.*" {
+ untested "No information available for stderr, exiting early"
+ return
+ }
+ -re "\\\$1.*" {
+ pass $gdb_test_name
+ }
+ }
+
with_test_prefix "fprintf" {
restart
return
}
- # Even if the the target reports that it does support target side
+ # Even if the target reports that it does support target side
# commands, we can only tell that it supports them in combination
# with a particular breakpoint type (Z0, Z1, etc.) when we try to
# insert the breakpoint. When "set breakpoint always-inserted is
# as expected. dprintf relies on support for target-side breakpoint
# commands --- use it as proxy.
if [gdb_is_target_remote] {
- gdb_test_no_output "set remote breakpoint-commands-packet off"
+ gdb_test \
+ "set remote breakpoint-commands-packet off" \
+ "Support for the 'BreakpointCommands' packet on the current remote target is set to \"off\"."
+
gdb_test "set dprintf-style agent" \
"warning: Target cannot run dprintf commands.*" \
"set dprintf-style agent, with feature disabled"