2002-03-26 Fred Fish <fnf@redhat.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / list.exp
index f319ba07c94acdc76d1873df62041c88d31f0177..9a4169c29790d39912b1c9544d1068afc3f7674f 100644 (file)
@@ -1,4 +1,5 @@
-# Copyright (C) 1992, 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2002
+# Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -92,9 +93,11 @@ proc test_listsize {} {
     gdb_test "show listsize" "Number of source lines gdb will list by default is 10.*" "show default list size"
     
     # Show the default lines
+    # Note that remote targets that have debugging info for _start available will
+    # list the lines there instead of main, so we skip this test for remote targets.
     # The second case is for optimized code, it is still correct.
     
-    if ![isnative] {
+    if [is_remote target] {
        runto_main;
        unsupported "list default lines around main";
     } else {
@@ -111,7 +114,7 @@ proc test_listsize {} {
     # Try just two lines
     
     if [ set_listsize 2 ] {
-       gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"" "list line 1 with listsize 2"
+       gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 1 with listsize 2"
        gdb_test "list 2" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 2 with listsize 2"
        gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+int main \[)(\]+" "list line 3 with listsize 2"
     }
@@ -119,18 +122,16 @@ proc test_listsize {} {
     # Try small listsize > 1 that is an odd number
 
     if [ set_listsize 3 ] {
-       setup_xfail "*-*-*"
-       gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"2\[ \t\]+" "list line 1 with listsize 3"
+       gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 1 with listsize 3"
        gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 2 with listsize 3"
-       
        gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+int main \[(\]+\[)\]+\r\n4\[ \t\]+\{" "list line 3 with listsize 3"
     }
 
     # Try small listsize > 2 that is an even number.
 
     if [ set_listsize 4 ] then {
-       gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 1 with listsize 4"
-       gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 2 with listsize 4"
+       gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 1 with listsize 4"
+       gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 2 with listsize 4"
        
        gdb_test "list 3" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 3 with listsize 4"
        gdb_test "list 4" "2\[ \t\]+\r\n.*5\[ \t\]+int x;.*" "list line 4 with listsize 4"
@@ -163,12 +164,12 @@ proc test_listsize {} {
 proc test_list_include_file {} {
     global gdb_prompt
 
-    setup_xfail "a29k-*-udi"
+    # OBSOLETE setup_xfail "a29k-*-udi"
     setup_xfail_format "DWARF 1"
     setup_xfail_format "COFF"
-    gdb_test "list list0.h:1" "1\[ \t\]+/\[*\]+ An include file .*4\[ \t\]+.*foo \(.*x.*\).*" "list line 1 in include file"
+    gdb_test "list list0.h:1" "1\[ \t\]+/\[*\]+ An include file .*10\[ \t\]+bar \\(x\\+\\+\\);" "list line 1 in include file"
 
-    setup_xfail "a29k-*-udi"
+    # OBSOLETE setup_xfail "a29k-*-udi"
     setup_xfail_format "DWARF 1"
     setup_xfail_format "COFF"
     gdb_test "list list0.h:100" "Line number 95 out of range; .*list0.h has 3\[67\] lines." "list message for lines past EOF"
@@ -185,7 +186,7 @@ proc test_list_filename_and_number {} {
 
     send_gdb "list list0.c:1\n"
     gdb_expect {
-       -re "1\[ \t\]+#include \"list0.h\".*5\[ \t\]+int x;\r\n$gdb_prompt $" {
+       -re "1\[ \t\]+#include \"list0.h\".*10\[ \t]+x = 0;\r\n$gdb_prompt $" {
            incr testcnt 
        }
        -re ".*$gdb_prompt $" { fail "list list0.c:1" ; gdb_suppress_tests }
@@ -230,8 +231,8 @@ proc test_list_function {} {
     # gcc appears to generate incorrect debugging information for code
     # in include files, which breaks this test.
     # SunPRO cc is the second case below, it's also correct.
-    setup_xfail "a29k-*-udi"
-    gdb_test "list main" "(5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;|1\[ \t\]+#include .*8\[ \t\]+breakpoint\[(\]\[)\]+;)" "list function in source file 1"
+    # OBSOLETE setup_xfail "a29k-*-udi"
+    gdb_test "list main" "(5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;|1\[ \t\]+#include .*10\[ \t\]+x = 0;)" "list function in source file 1"
 
     # Ultrix gdb takes the second case below; it's also correct.
     # SunPRO cc is the third case.
@@ -395,10 +396,10 @@ proc test_list_filename_and_function {} {
     # gcc appears to generate incorrect debugging information for code
     # in include files, which breaks this test.
     # SunPRO cc is the second case below, it's also correct.
-    setup_xfail "a29k-*-udi"
+    # OBSOLETE setup_xfail "a29k-*-udi"
     send_gdb "list list0.c:main\n"
     gdb_expect {
-       -re "1\[ \t\]+#include .*8\[ \t\]+breakpoint\[(\]\[)\]+;\r\n$gdb_prompt $" {
+       -re "1\[ \t\]+#include .*10\[ \t\]+x = 0;\r\n$gdb_prompt $" {
            incr testcnt
        }
        -re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
@@ -408,7 +409,8 @@ proc test_list_filename_and_function {} {
        timeout { fail "list list0.c:main (timeout)" }
     }
 
-    # The i960 and a29k-amd-udi are the second case
+    # The i960 is a second case
+    # OBSOLETE # The a29k-amd-udi is a second case
 
     # Not sure what the point of having this function be unused is.
     # AIX is legitimately removing it.
@@ -432,7 +434,7 @@ proc test_list_filename_and_function {} {
     # SunPRO cc is the third case.
     setup_xfail "rs6000-*-*" 1804
     setup_xfail "powerpc-*-*" 1804
-    setup_xfail "a29k-*-udi"
+    # OBSOLETE setup_xfail "a29k-*-udi"
     setup_xfail_format "DWARF 1"
     setup_xfail_format "COFF"
     send_gdb "list list0.h:foo\n"
@@ -454,7 +456,7 @@ proc test_list_filename_and_function {} {
     }
 
     # Ultrix gdb is the second case.
-    # a29k-amd-udi is the third case.
+    # OBSOLETE # a29k-amd-udi is the third case.
     send_gdb "list list1.c:bar\n"
     gdb_expect {
        -re "4\[ \t\]+void.*13\[ \t\]+\}\r\n$gdb_prompt $" {
@@ -470,7 +472,8 @@ proc test_list_filename_and_function {} {
        timeout { fail "list list1.c:bar (timeout)" }
     }
 
-    # The i960 and a29k-amd-udi are the second case
+    # The i960 is a second case
+    # OBSOLETE # The a29k-amd-udi is a second case
 
     # Not sure what the point of having this function be unused is.
     # AIX is legitimately removing it.
This page took 0.04799 seconds and 4 git commands to generate.