]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* gdb.asm/asm-source.exp: Parse the output from `info sources' one
authorJim Blandy <jimb@codesourcery.com>
Thu, 21 Feb 2002 20:58:25 +0000 (20:58 +0000)
committerJim Blandy <jimb@codesourcery.com>
Thu, 21 Feb 2002 20:58:25 +0000 (20:58 +0000)
filename at a time, and watch for the ones we want to see.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.asm/asm-source.exp

index 645e78b3907e572501bf58e5d38fe8598584fc78..f0e4d7341012d2ebf667ba43328a5b3ba75b8513 100644 (file)
@@ -1,5 +1,8 @@
 2002-02-21  Jim Blandy  <jimb@redhat.com>
 
+       * gdb.asm/asm-source.exp: Parse the output from `info sources' one
+       filename at a time, and watch for the ones we want to see.
+
        * gdb.base/ptype.exp, gdb.base/ptype.c: Add tests for printing
        types of pointers to prototyped functions.
 
index fbcfa7cff50766cb61e0030501d62983a24da60e..471b31a6df6237147c92ba990803ee5872f53f47 100644 (file)
@@ -202,10 +202,37 @@ gdb_test "info source" \
        "Current source file is .*asmsrc2.s.*Source language is asm.*" \
        "info source asmsrc2.s"
 
-# Try 'info sources'
-gdb_test "info sources" \
-       "Source files .*asmsrc\[12\].s.*asmsrc\[12\].s.*" \
-       "info sources"
+# Try 'info sources'.  This can produce a lot of output on systems
+# with dynamic linking, where the system's shared libc was compiled
+# with debugging info; for example, on Linux, this produces 47kb of
+# output.  So we consume it as we go.
+send_gdb "info sources\n"
+set seen_asmsrc_1 0
+set seen_asmsrc_2 0
+gdb_expect {
+    -re "^\[^,\]*asmsrc1.s(, |\[\r\n\]+)" {
+        set seen_asmsrc_1 1
+        exp_continue
+    }
+    -re "^\[^,\]*asmsrc2.s(, |\[\r\n\]+)" {
+        set seen_asmsrc_2 1
+        exp_continue
+    }
+    -re ", " { 
+        exp_continue
+    }
+    -re "$gdb_prompt $" {
+        if {$seen_asmsrc_1 && $seen_asmsrc_2} {
+            pass "info sources"
+        } else {
+            fail "info sources"
+        }
+    }
+    timeout {
+            fail "info sources (timeout)"
+    }
+}
+        
 
 # Try 'info line'
 gdb_test "info line" \