set testfile "list"
set binfile ${objdir}/${subdir}/${testfile}
-# There are some rather large lines in some of these source files.
-set match_max 10000;
-
# Need to download the header to the host.
remote_download host ${srcdir}/${subdir}/list0.h list0.h
# This doesn't work for COFF targets.
setup_xfail "a29k-*-udi"
+ if ![isnative] {
+ if [target_info exists gdb,start_symbol] {
+ set startsym [target_info gdb,start_symbol];
+ } else {
+ set startsym "start";
+ }
+ gdb_test "set \$pc=$startsym" "" ""
+ }
gdb_test "list" "(1\[ \t\]+#include \"list0.h\".*10\[ \t\]+x = 0;|2.*11\[ \t\]+foo .x\[+)\]+;)" "list default lines around main"
-
+
# Ensure we can limit printouts to one line
-
+
if [ set_listsize 1 ] then {
setup_xfail "*-*-*"
gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"" "list line 1 with listsize 1"
proc test_list_include_file {} {
global gdb_prompt
- # FIXME Fails for COFF as well, I think.
setup_xfail "a29k-*-udi"
+ setup_xfail_format "DWARF 1"
+ setup_xfail_format "COFF"
gdb_test "list list0.h:1" "1\[ \t\]+/\[*\]+ An include file .*5\[ \t\]+foo \[(\]+x\[)\]+" "list line 1 in include file"
- # FIXME Fails for COFF as well, I think.
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 36 lines." "list message for lines past EOF"
}
# Ultrix gdb is the second case, still correct.
# SunPRO cc is the third case.
setup_xfail "powerpc-*-*"
+ setup_xfail_format "DWARF 1"
gdb_test "list foo" "(3\[ \t\]+.*12\[ \t\]+bar \[(\]+.*\[)\]+;|2\[ \t\]+including file.*11\[ \t\]+bar \[(\]+.*\[)\]+;|1\[ \t\]+/. An include file.*10\[ \t\]+bar \[(\]+.*\[)\]+;)" "list function in include file"
}
# SunPRO cc is the third case.
setup_xfail "rs6000-*-*" 1804
setup_xfail "powerpc-*-*" 1804
- # FIXME Fails for COFF as well, I think.
setup_xfail "a29k-*-udi"
+ setup_xfail_format "DWARF 1"
+ setup_xfail_format "COFF"
send_gdb "list list0.h:foo\n"
gdb_expect {
-re "2\[ \t\]+including file. This.*11\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
gdb_test "list foobar.c:main" "No source file named foobar.c." "list filename:function; nonexistant file"
+ setup_xfail_format "DWARF 1"
gdb_test "list list0.h:foobar" "Function \"foobar\" not defined." "list filename:function; nonexistant function"
}
set oldtimeout $timeout
set timeout [expr "$timeout + 300"]
verbose "Timeout is now $timeout seconds" 2
- match_max 10000
gdb_test "search 1234" ".*1234.*" "search extremely long line (> 5000 chars)"
set timeout $oldtimeout
verbose "Timeout is now $timeout seconds" 2
gdb_test "set width 0" "" "set width 0"
test_listsize
+get_debug_format
if [ set_listsize 10 ] then {
test_list_include_file
test_list_filename_and_number
-# Copyright (C) 1988, 1990, 1991, 1992, 1994 Free Software Foundation, Inc.
+# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997 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
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
# pre-2.4.5 versions of gcc and most non-gcc compilers).
send_gdb "ptype red1\n"
-expect {
+gdb_expect {
-re "type = enum primary1_tag \{red1, green1, blue1\}.*$gdb_prompt $"\
{
# The workaround is in effect. As this is a compiler, not GDB,
gdb_test "ptype boolean" "type = enum \{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration"
# And check that whatis shows the name, not "enum {...}".
-
+# This probably fails for all DWARF 1 cases, so assume so for now. -fnf
# The problem with xlc is that the stabs look like
# :t51=eFALSE:0,TRUE:1,;
# boolean:t55=51
# as (51) doesn't have a name. Only 55 has a name.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
+setup_xfail_format "DWARF 1"
gdb_test "whatis v_boolean" "type = boolean" \
"whatis unnamed typedef'd enum (compiler bug in IBM's xlc)"
#setup_xfail "i960-*-*" 1821
#setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*"
#send "ptype v_char\n"
-#expect {
+#gdb_expect {
# -re "type = char.*$gdb_prompt $" { pass "ptype char" }
# -re ".*$gdb_prompt $" { fail "ptype char" }
# timeout { fail "(timeout) ptype char" }
#
#setup_xfail "mips-*-*" "a29k-*-*"
#send "ptype v_signed_char\n"
-#expect {
+#gdb_expect {
# -re "type = signed char.*$gdb_prompt $" { pass "ptype signed char" }
# -re ".*$gdb_prompt $" { fail "ptype signed char" }
# timeout { fail "(timeout) ptype signed char" }
#
#
#send "ptype v_unsigned_char\n"
-#expect {
+#gdb_expect {
# -re "type = unsigned char.*$gdb_prompt $" { pass "ptype unsigned char" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned char" }
# timeout { fail "(timeout) ptype unsigned char" }
gdb_test "ptype v_short" "type = short(| int).*" "ptype short"
#send "ptype v_signed_short\n"
-#expect {
+#gdb_expect {
# -re "type = short.*$gdb_prompt $" { pass "ptype signed short" }
# -re ".*$gdb_prompt $" { fail "ptype signed short" }
# timeout { fail "(timeout) ptype signed short" }
#
#
#send "ptype v_unsigned_short\n"
-#expect {
+#gdb_expect {
# -re "type = unsigned short.*$gdb_prompt $" { pass "ptype unsigned short" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned short" }
# timeout { fail "(timeout) ptype unsigned short" }
gdb_test "ptype v_int" "type = int.*" "ptype int"
#send "ptype v_signed_int\n"
-#expect {
+#gdb_expect {
# -re "type = int.*$gdb_prompt $" { pass "ptype signed int" }
# -re ".*$gdb_prompt $" { fail "ptype signed int" }
# timeout { fail "(timeout) ptype signed int" }
#
#
#send "ptype v_unsigned_int\n"
-#expect {
+#gdb_expect {
# -re "type = unsigned int.*$gdb_prompt $" { pass "ptype unsigned int" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned int" }
# timeout { fail "(timeout) ptype unsigned int" }
#
#
#send "ptype v_long\n"
-#expect {
+#gdb_expect {
# -re "type = long.*$gdb_prompt $" { pass "ptype long" }
# -re ".*$gdb_prompt $" { fail "ptype long" }
# timeout { fail "(timeout) ptype long" }
#
#
#send "ptype v_signed_long\n"
-#expect {
+#gdb_expect {
# -re "type = long.*$gdb_prompt $" { pass "ptype signed long" }
# -re ".*$gdb_prompt $" { fail "ptype signed long" }
# timeout { fail "(timeout) ptype signed long" }
#
#
#send "ptype v_unsigned_long\n"
-#expect {
+#gdb_expect {
# -re "type = unsigned long.*$gdb_prompt $" { pass "ptype unsigned long" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned long" }
# timeout { fail "(timeout) ptype unsigned long" }
#
#
#send "ptype v_float\n"
-#expect {
+#gdb_expect {
# -re "type = float.*$gdb_prompt $" { pass "ptype float" }
# -re ".*$gdb_prompt $" { fail "ptype float" }
# timeout { fail "(timeout) ptype float" }
#
#
#send "ptype v_double\n"
-#expect {
+#gdb_expect {
# -re "type = double.*$gdb_prompt $" { pass "ptype double" }
# -re ".*$gdb_prompt $" { fail "ptype double" }
# timeout { fail "(timeout) ptype double" }
#setup_xfail "i960-*-*" 1821
#setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*"
#send "ptype v_char_array\n"
-#expect {
+#gdb_expect {
# -re "type = char .2..*$gdb_prompt $" { pass "ptype char array" }
# -re ".*$gdb_prompt $" { fail "ptype char array" }
# timeout { fail "(timeout) ptype char array" }
#
#setup_xfail "mips-*-*" "a29k-*-*"
#send "ptype v_signed_char_array\n"
-#expect {
+#gdb_expect {
# -re "type = (|signed )char .2..*$gdb_prompt $" { pass "ptype signed char array" }
# -re ".*$gdb_prompt $" { fail "ptype signed char array" }
# timeout { fail "(timeout) ptype signed char array" }
#
#
#send "ptype v_unsigned_char_array\n"
-#expect {
+#gdb_expect {
# -re "type = unsigned char .2..*$gdb_prompt $" { pass "ptype unsigned char array" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned char array" }
# timeout { fail "(timeout) ptype unsigned char array" }
#
#
#send "ptype v_int_array\n"
-#expect {
+#gdb_expect {
# -re "type = int .2..*$gdb_prompt $" { pass "ptype int array" }
# -re ".*$gdb_prompt $" { fail "ptype int array" }
# timeout { fail "(timeout) ptype int array" }
#
#
#send "ptype v_signed_int_array\n"
-#expect {
+#gdb_expect {
# -re "type = int .2..*$gdb_prompt $" { pass "ptype signed int array" }
# -re ".*$gdb_prompt $" { fail "ptype signed int array" }
# timeout { fail "(timeout) ptype signed int array" }
#
#
#send "ptype v_unsigned_int_array\n"
-#expect {
+#gdb_expect {
# -re "type = unsigned int .2..*$gdb_prompt $" { pass "ptype unsigned int array" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned int array" }
# timeout { fail "(timeout) ptype unsigned int array" }
#
#
#send "ptype v_long_array\n"
-#expect {
+#gdb_expect {
# -re "type = (long|int|long int) .2..*$gdb_prompt $" {
# pass "ptype long array" }
# -re ".*$gdb_prompt $" { fail "ptype long array" }
#
#
#send "ptype v_signed_long_array\n"
-#expect {
+#gdb_expect {
# -re "type = (long|int|long int) .2..*$gdb_prompt $" {
# pass "ptype signed long array" }
# -re ".*$gdb_prompt $" { fail "ptype signed long array" }
#
#
#send "ptype v_unsigned_long_array\n"
-#expect {
+#gdb_expect {
# -re "type = unsigned long .2..*$gdb_prompt $" { pass "ptype unsigned long array" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned long array" }
# timeout { fail "(timeout) ptype unsigned long array" }
#
#
#send "ptype v_float_array\n"
-#expect {
+#gdb_expect {
# -re "type = float .2..*$gdb_prompt $" { pass "ptype float array" }
# -re ".*$gdb_prompt $" { fail "ptype float array" }
# timeout { fail "(timeout) ptype float array" }
#
#
#send "ptype v_double_array\n"
-#expect {
+#gdb_expect {
# -re "type = double .2..*$gdb_prompt $" { pass "ptype double array" }
# -re ".*$gdb_prompt $" { fail "ptype double array" }
# timeout { fail "(timeout) ptype double array" }
#
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
+setup_xfail_format "DWARF 1"
gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
#
#setup_xfail "i960-*-*" 1821
#setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*"
#send "ptype v_char_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = char \*.*$gdb_prompt $" { pass "ptype char pointer" }
# -re ".*$gdb_prompt $" { fail "ptype char pointer" }
# timeout { fail "(timeout) ptype char pointer" }
#
#setup_xfail "mips-*-*" "a29k-*-*"
#send "ptype v_signed_char_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = (|signed )char \*.*$gdb_prompt $"
# { pass "ptype signed char pointer" }
# -re ".*$gdb_prompt $" { fail "ptype signed char pointer" }
#
#
#send "ptype v_unsigned_char_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = unsigned char \*.*$gdb_prompt $" { pass "ptype unsigned char pointer" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned char pointer" }
# timeout { fail "(timeout) ptype unsigned char pointer" }
#
#
#send "ptype v_short_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = (short|short int) \*.*$gdb_prompt $" { pass "ptype short pointer" }
# -re ".*$gdb_prompt $" { fail "ptype short pointer" }
# timeout { fail "(timeout) ptype short pointer" }
#
#
#send "ptype v_signed_short_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = short \*.*$gdb_prompt $" { pass "ptype signed short pointer" }
# -re ".*$gdb_prompt $" { fail "ptype signed short pointer" }
# timeout { fail "(timeout) ptype signed short pointer" }
#
#
#send "ptype v_unsigned_short_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = unsigned short \*.*$gdb_prompt $" { pass "ptype unsigned short pointer" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned short pointer" }
# timeout { fail "(timeout) ptype unsigned short pointer" }
#
#
#send "ptype v_int_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = int \*.*$gdb_prompt $" { pass "ptype int pointer" }
# -re ".*$gdb_prompt $" { fail "ptype int pointer" }
# timeout { fail "(timeout) ptype int pointer" }
#
#
#send "ptype v_signed_int_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = int \*.*$gdb_prompt $" { pass "ptype signed int pointer" }
# -re ".*$gdb_prompt $" { fail "ptype signed int pointer" }
# timeout { fail "(timeout) ptype signed int pointer" }
#
#
#send "ptype v_unsigned_int_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = unsigned int \*.*$gdb_prompt $" { pass "ptype unsigned int pointer" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned int pointer" }
# timeout { fail "(timeout) ptype unsigned int pointer" }
#
#
#send "ptype v_long_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = long \*.*$gdb_prompt $" { pass "ptype long pointer" }
# -re ".*$gdb_prompt $" { fail "ptype long pointer" }
# timeout { fail "(timeout) ptype long pointer" }
#
#
#send "ptype v_signed_long_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = long \*.*$gdb_prompt $" { pass "ptype signed long pointer" }
# -re ".*$gdb_prompt $" { fail "ptype signed long pointer" }
# timeout { fail "(timeout) ptype signed long pointer" }
#
#
#send "ptype v_unsigned_long_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = unsigned long \*.*$gdb_prompt $" { pass "ptype unsigned long pointer" }
# -re ".*$gdb_prompt $" { fail "ptype unsigned long pointer" }
# timeout { fail "(timeout) ptype unsigned long pointer" }
#
#
#send "ptype v_float_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = float \*.*$gdb_prompt $" { pass "ptype float pointer" }
# -re ".*$gdb_prompt $" { fail "ptype float pointer" }
# timeout { fail "(timeout) ptype float pointer" }
#
#
#send "ptype v_double_pointer\n"
-#expect {
+#gdb_expect {
# -re "type = double \*.*$gdb_prompt $" { pass "ptype double pointer" }
# -re ".*$gdb_prompt $" { fail "ptype double pointer" }
# timeout { fail "(timeout) ptype double pointer" }
if [runto_main] then {
+ get_debug_format
if [target_info exists gdb,cannot_call_functions] {
setup_xfail "*-*-*" 2416
fail "This target can not call functions"