* lib/gdb.exp (setup_xfail_format): New function.
(get_debug_format): New function to get debug format. (debug_format): New global variable to hold last value set by get_debug_format. * gdb.base/list.exp: Call get_debug_format and expect some tests to fail for DWARF 1 and COFF formats. * gdb.c++/ptype.exp: Ditto. * gdb.c++/classes.exp: Ditto. * gdb.c++/cplusfuncs.exp: Ditto. * gdb.c++/inherit.exp: Ditto. * gdb.c++/templates.exp: Ditto. * gdb.c++/virtfunc.exp: Ditto.
This commit is contained in:
parent
08d8f99560
commit
70742cd831
4 changed files with 125 additions and 50 deletions
|
@ -29,9 +29,6 @@ set bug_id 0
|
|||
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
|
||||
|
||||
|
@ -83,10 +80,18 @@ proc test_listsize {} {
|
|||
|
||||
# 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"
|
||||
|
@ -151,12 +156,14 @@ proc test_listsize {} {
|
|||
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"
|
||||
}
|
||||
|
||||
|
@ -227,6 +234,7 @@ proc test_list_function {} {
|
|||
# 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"
|
||||
}
|
||||
|
||||
|
@ -375,8 +383,9 @@ proc test_list_filename_and_function {} {
|
|||
# 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 $" {
|
||||
|
@ -447,6 +456,7 @@ proc test_list_filename_and_function {} {
|
|||
|
||||
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"
|
||||
|
||||
}
|
||||
|
@ -470,7 +480,6 @@ proc test_forward_search {} {
|
|||
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
|
||||
|
@ -496,6 +505,7 @@ if [target_info exists gdb_stub] {
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue