[PATCH 3/3] Fix a FAIL in attach.exp under native-extended-gdbserver

Andreas Arnez arnez@linux.vnet.ibm.com
Wed Mar 14 16:13:00 GMT 2018


The attach.exp test case yields a FAIL with native-extended-gdbserver when
trying to start a new process.  This is because gdbserver does not support
starting new processes.  And since the gdbserver-base board file sets the
GDB command line option -ex "set auto-connect-native-target off", the
process is not started on the native target either.  An error message
results instead:

  Don't know how to run.  Try "help target".

Thus just accept this error when not running on a native target.

gdb/testsuite/ChangeLog:

	* gdb.base/attach.exp: Accept the error message "don't know how to
	run" when not running on a native target.
---
 gdb/testsuite/gdb.base/attach.exp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index efec49e385..1651dc40a7 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -421,11 +421,18 @@ proc test_command_line_attach_run {} {
 
 	send_gdb "y\n"
 
+	set cantrun 0
 	set test "run to main"
 	gdb_test_multiple "" $test {
 	    -re "Temporary breakpoint .* main .*$gdb_prompt $" {
 		pass $test
 	    }
+	    -re "Don't know how to run..*$gdb_prompt $" {
+		set cantrun 1
+	    }
+	}
+	if { $cantrun && [gdb_is_target_native] } {
+	    fail $test
 	}
 
 	# Get rid of the process
-- 
2.14.3



More information about the Gdb-patches mailing list