@@ -109,6 +109,24 @@ gdb_test_multiple "set dprintf-style age
}
if $target_can_dprintf {
+ # Second check to make sure current target support breakpoints that have target side commands
+ gdb_run_cmd
+
+ gdb_test "" "Breakpoint"
+
+ set msg "Send dprintf to target"
+ gdb_test_multiple "continue" $msg {
+ -re "Warning:.*Target doesn't support breakpoints that have target side commands.*\r\n$gdb_prompt $" {
+ 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"
@@ -120,7 +138,7 @@ if $target_can_dprintf {
gdb_test_sequence "info breakpoints" "dprintf info 2" {
"\[\r\n\]Num Type Disp Enb Address +What"
"\[\r\n\]2 breakpoint"
- "\[\r\n\]\tbreakpoint already hit 2 times"
+ "\[\r\n\]\tbreakpoint already hit 3 times"
"\[\r\n\]3 dprintf"
"\[\r\n\]\tbreakpoint already hit 2 times"
"\[\r\n\] agent-printf \"At foo entry\\\\n\""
@@ -140,6 +140,14 @@ gdb_expect {
}
if $target_can_dprintf {
+ # Second check to make sure current target support breakpoints that have target side commands
+ if {[mi_run_cmd] < 0} {
+ set target_can_dprintf 0
+ unsupported "send dprintf to target"
+ }
+}
+
+if $target_can_dprintf {
mi_run_cmd
mi_expect_stop ".*" ".*" ".*" ".*" ".*" "" "mi expect stop"
@@ -893,6 +893,7 @@ proc mi_run_cmd_full {use_mi_command arg
send_gdb "${run_prefix}continue\n"
gdb_expect 60 {
-re "${run_match}\\^running\[\r\n\]+\\*running,thread-id=\"\[^\"\]+\"\r\n$mi_gdb_prompt" {}
+ -re "${run_match}\\^error.*" {return -1}
default {}
}
return 0