-# 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
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 {
# 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"
}
# 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"
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"
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 }
# 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.
# 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 $" {
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.
# 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"
}
# 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 $" {
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.