gdb_test_no_output "set debug target 1"
set test "probe target hardware step"
- gdb_test_multiple "si" $test {
+ gdb_test_multiple "pipe si | grep resume" $test {
-re "resume \\(\[^\r\n\]+, step, .*$gdb_prompt $" {
set hw_step 1
pass $test
}
# Try a malformed `set charset'.
-gdb_test "set charset" \
- "Requires an argument. Valid arguments are.*" \
- "try malformed `set charset'"
+set cmd "set charset"
+set ok 0
+gdb_test_multiple $cmd "try malformed `set charset'" {
+ -re "^$cmd\r\nRequires an argument. Valid arguments are " {
+ set ok 1
+ exp_continue
+ }
+ -re ", " {
+ exp_continue
+ }
+ -re -wrap "" {
+ gdb_assert { $ok } $gdb_test_name
+ }
+}
# Try using `set host-charset' on an invalid character set.
gdb_test "set host-charset my_grandma_bonnie" \
clean_restart $::binfile
gdb_test "core-file $corefile" "Core was generated by .*" "run: load core again"
- gdb_test "info files" "\r\nLocal core dump file:\r\n.*" "run: sanity check we see the core file"
+ set re "Local core dump file:"
+ gdb_test "pipe info files | grep \"$re\"" \
+ "Local core dump file:" \
+ "run: sanity check we see the core file"
set test "run: with core"
if [runto_main] {
}
set test "run: core file is cleared"
- gdb_test_multiple "info files" $test {
- -re "\r\nLocal core dump file:\r\n.*\r\n$gdb_prompt $" {
+ set re "Local core dump file:"
+ gdb_test_multiple "pipe info files | grep \"$re\"" $test {
+ -re -wrap $re {
fail $test
}
- -re "\r\n$gdb_prompt $" {
+ -re -wrap "" {
pass $test
}
}
gdb_test "attach $pid" "Attaching to process $pid\r\n.*" "attach: with core"
set test "attach: core file is cleared"
- gdb_test_multiple "info files" $test {
- -re "\r\nLocal core dump file:\r\n.*\r\n$gdb_prompt $" {
+ set re "Local core dump file:"
+ gdb_test_multiple "pipe info files | grep \"$re\"" $test {
+ -re -wrap $re {
fail $test
}
- -re "\r\n$gdb_prompt $" {
+ -re -wrap "" {
pass $test
}
}
proc test_set_osabi_none { } {
clean_restart
gdb_test_no_output "set debug arch 1"
- gdb_test "set osabi none" ".*gdbarch_find_by_info: info.osabi 1 \\(none\\).*"
+ gdb_test "pipe set osabi none | grep gdbarch_find_by_info" \
+ ".*gdbarch_find_by_info: info.osabi 1 \\(none\\).*"
}
test_set_osabi_none
gdb_test_no_output "set debug target 1"
set hardware_step 0
set test "probe target hardware step"
-gdb_test_multiple "si" $test {
+gdb_test_multiple "pipe si | grep resume" $test {
-re "resume \\(\[^\r\n\]+, step, .*$gdb_prompt $" {
set hardware_step 1
pass $test
clean_restart $executable
gdb_test "core-file $corefile" "Core was generated by .*" "load core"
-gdb_test "info files" "\r\nLocal core dump file:\r\n.*" "sanity check we see the core file"
-
+set re "Local core dump file:"
+gdb_test "pipe info files | grep \"$re\"" \
+ $re \
+ "sanity check we see the core file"
set test "print pthread_t of thread0"
gdb_test_multiple "p/x thread0" $test {
-re " = (0x\[0-9a-f\]+)\r\n$gdb_prompt $" {