[PATCH] gdb.mi/mi-info-os.exp: Fix cross-debugger testing

Maciej W. Rozycki macro@codesourcery.com
Fri Nov 1 01:17:00 GMT 2013


Hi,

 A live target is required for `-info-os' to work in non-native 
configurations.  Here's a fix for gdb.mi/mi-info-os.exp that removes the 
following failure:

(gdb)
Expecting: ^(-info-os[
]+)?(.*\^done,OSDataTable=.*[
]+[(]gdb[)]
[ ]*)
-info-os
^error,msg="Don't know how to get OS data.  Try \"help target\"."
(gdb)
FAIL: gdb.mi/mi-info-os.exp: -info-os

Tested with mips-linux-gnu (crossed from i686-linux-gnu).  OK to apply?

2011-11-01  Maciej W. Rozycki  <macro@codesourcery.com>

	gdb/testsuite/
	* gdb.mi/mi-info-os.exp: Connect to the target in non-native 
	configurations.

  Maciej

gdb-test-mi-info-os.diff
Index: gdb-fsf-trunk-quilt/gdb/testsuite/gdb.mi/mi-info-os.exp
===================================================================
--- gdb-fsf-trunk-quilt.orig/gdb/testsuite/gdb.mi/mi-info-os.exp	2013-11-01 00:52:48.000000000 +0000
+++ gdb-fsf-trunk-quilt/gdb/testsuite/gdb.mi/mi-info-os.exp	2013-11-01 00:56:43.588756235 +0000
@@ -33,6 +33,20 @@ if [mi_gdb_start] {
     continue
 }
 
+# In non-native configurations we need to have a live target.
+if { ![isnative] } {
+    standard_testfile basics.c
+
+    if [build_executable "Failed to build $testfile" $testfile $srcfile \
+	debug] {
+	return -1;
+    }
+
+    if {[mi_run_to_main] < 0} {
+	return -1
+    }
+}
+
 # Try the argument-less form that lists all the types in a table.
 
 mi_gdb_test "-info-os" ".*\\^done,OSDataTable=.*" "-info-os"



More information about the Gdb-patches mailing list