diff options
Diffstat (limited to 'gdb/testsuite')
27 files changed, 106 insertions, 1169 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 7ba5c69..aa6abb4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,99 +1,3 @@ -2004-10-14 Andrew Cagney <cagney@gnu.org> - - * gdb.mi/gdb701.c (main): Return 0. - -2004-10-13 Daniel Jacobowitz <dan@debian.org> - - * gdb.dwarf2/dw2-intercu.S, gdb.dwarf2/dw2-intercu.exp: New files. - -2004-10-12 Jeff Johnston <jjohnstn@redhat.com> - - * gdb.threads/schedlock.c: Add comment markers to use to find - line numbers. - * gdb.threads/schedlock.exp: Adjust regex to handle the new - comments. - * gdb.threads/watchthreads.exp: Use gdb_get_line_number to find - breakpoint lines. - -2004-10-12 Daniel Jacobowitz <dan@debian.org> - - * gdb.dwarf2/dw2-basic.exp: Run on Hurd also. - -2004-10-12 Daniel Jacobowitz <dan@debian.org> - - * configure.in: Add gdb.dwarf2. - * configure: Regenerated. - * Makefile.in: Add gdb.dwarf2. - * gdb.dwarf2/Makefile.in, gdb.dwarf2/dw2-basic.S, - gdb.dwarf2/dw2-basic.exp, gdb.dwarf2/main.c, - gdb.dwarf2/file1.txt: New files. - -2004-10-11 Orjan Friberg <orjanf@axis.com> - - * gdb.threads/bp_in_thread.exp: Use runto_main and "continue" instead - of "run", since the latter doesn't work with remote targets. Adjust - the breakpoint numbering accordingly. - * gdb.threads/pthread_cond_wait.exp: Ditto. - -2004-10-08 Michael Chastain <mec.gnu@mindspring.com> - - * gdb.base/overlays.exp: Update copyright years. - -2004-10-08 Kei Sakamoto <sakamoto.kei@renesas.com> - - * gdb.base/overlays.exp: Disable if target is Linux. - -2004-10-06 Felix Lee <felix+log1@specifixinc.com> - - * config/gdbserver.exp (gdb_load): Use right filename on remote. - -2004-10-05 Kei Sakamoto <sakamoto.kei@renesas.com> - - * gdb.asm/asm-source.exp: Add m32r-linux target. - * gdb.asm/m32r-linux.inc: New file. - -2004-09-24 Andrew Cagney <cagney@redhat.com> - David Anderson <anderson@redhat.com> - - * gdb.base/bigcore.exp (extract_heap): If the expect "file size" - command fails, assume things will work. - * gdb.base/bigcore.c: Include <sys/stat.h> and <fcntl.h>. - (_GNU_SOURCE): Define. - (print_unsigned, print_hex): Change parameter to "long long". - (print_byte_count): New function, use to print byte counts. - (large_off_t, large_lseek, O_LARGEFILE): Define dependant on - O_LARGEFILE. - (main): Compute an upper bound on a corefile in max_core_size. - Limit memory chunk size to max_core_size. Limit total memory - allocated to max_core_size. - -2004-09-23 Andrew Cagney <cagney@gnu.org> - - * gdb.base/bigcore.exp: Replace the code that creates a corefile - from a separate process with code that creates a corefile by - making the inferior dump core. - -2004-09-23 Mark Kettenis <kettenis@gnu.org> - - * gdb.base/sigstep.exp: Avoid comments withing gdb_test_multiple - block. - -2004-09-23 Michael Chastain <mec.gnu@mindspring.com> - - * gdb.base/constvars.exp (local_compiler_xfail_check_2): - New proc. Accept both gcc 3.x.x and gcc 4.x.x. - * gdb.base/volatile.exp (local_compiler_xfail_check_2): - Likewise. - -2004-09-20 Jeff Johnston <jjohnstn@redhat.com> - - * gdb.java/jprint.exp: New test case for java inferior call. - * gdb.java/jprint.java: Ditto. - -2004-09-15 Joel Brobecker <brobecker@gnat.com> - - * gdb.base/bigcore.exp: Deactivate on IRIX targets. - 2004-09-14 Michael Chastain <mec.gnu@mindspring.com> * gdb.threads/killed.c: Include <stdlib.h>. diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in index 5aa8262..d9be89c 100644 --- a/gdb/testsuite/Makefile.in +++ b/gdb/testsuite/Makefile.in @@ -36,7 +36,6 @@ EXEEXT = @EXEEXT@ SUBDIRS = @subdirs@ RPATH_ENVVAR = @RPATH_ENVVAR@ ALL_SUBDIRS = gdb.ada gdb.arch gdb.asm gdb.base gdb.cp gdb.disasm \ - gdb.dwarf2 \ gdb.fortran gdb.java gdb.mi gdb.objc gdb.threads gdb.trace \ $(SUBDIRS) diff --git a/gdb/testsuite/config/gdbserver.exp b/gdb/testsuite/config/gdbserver.exp index 6dc6b23..ed812f8 100644 --- a/gdb/testsuite/config/gdbserver.exp +++ b/gdb/testsuite/config/gdbserver.exp @@ -207,7 +207,7 @@ proc gdb_load { arg } { } } - set res [gdbserver_gdb_load $server_exec] + set res [gdbserver_gdb_load $host_exec] set protocol [lindex $res 0] set gdbport [lindex $res 1] diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure index 43a843f..271e11d 100755 --- a/gdb/testsuite/configure +++ b/gdb/testsuite/configure @@ -1052,8 +1052,8 @@ ac_given_srcdir=$srcdir trap 'rm -fr `echo "Makefile \ gdb.ada/Makefile gdb.ada/gnat_ada.gpr:gdb.ada/gnat_ada.gin \ gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ - gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ - gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \ + gdb.cp/Makefile gdb.disasm/Makefile gdb.fortran/Makefile \ + gdb.java/Makefile gdb.mi/Makefile \ gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <<EOF @@ -1149,8 +1149,8 @@ cat >> $CONFIG_STATUS <<EOF CONFIG_FILES=\${CONFIG_FILES-"Makefile \ gdb.ada/Makefile gdb.ada/gnat_ada.gpr:gdb.ada/gnat_ada.gin \ gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ - gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ - gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \ + gdb.cp/Makefile gdb.disasm/Makefile gdb.fortran/Makefile \ + gdb.java/Makefile gdb.mi/Makefile \ gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile"} EOF cat >> $CONFIG_STATUS <<\EOF diff --git a/gdb/testsuite/configure.in b/gdb/testsuite/configure.in index 02c0a04..8b90e04 100644 --- a/gdb/testsuite/configure.in +++ b/gdb/testsuite/configure.in @@ -121,6 +121,6 @@ AC_CONFIG_SUBDIRS($configdirs) AC_OUTPUT([Makefile \ gdb.ada/Makefile gdb.ada/gnat_ada.gpr:gdb.ada/gnat_ada.gin \ gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ - gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ - gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \ + gdb.cp/Makefile gdb.disasm/Makefile gdb.fortran/Makefile \ + gdb.java/Makefile gdb.mi/Makefile \ gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile]) diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp index fcd0ae0..e2c9e8a 100644 --- a/gdb/testsuite/gdb.asm/asm-source.exp +++ b/gdb/testsuite/gdb.asm/asm-source.exp @@ -71,9 +71,6 @@ switch -glob -- [istarget] { "i\[3456\]86-*-*" { set asm-arch i386 } - "m32r*-linux*" { - set asm-arch m32r-linux - } "m32r*-*" { set asm-arch m32r append link-flags "--whole-archive -lgloss --no-whole-archive" diff --git a/gdb/testsuite/gdb.asm/m32r-linux.inc b/gdb/testsuite/gdb.asm/m32r-linux.inc deleted file mode 100644 index 64d6504..0000000 --- a/gdb/testsuite/gdb.asm/m32r-linux.inc +++ /dev/null @@ -1,34 +0,0 @@ - comment "subroutine prologue" - .macro gdbasm_enter - push fp -> push lr - addi sp,#-4 -> mv fp,sp - .endm - - comment "subroutine epilogue" - .macro gdbasm_leave - addi sp,#4 -> pop lr - pop fp -> jmp lr - .endm - - .macro gdbasm_call subr - bl \subr - .endm - - .macro gdbasm_several_nops - nop - nop - nop - nop - .endm - - comment "exit (0)" - .macro gdbasm_exit0 - ldi r0,#1 -> ldi r1,#0 - ldi r2,#0 -> ldi r3,#0 - trap #0 -> nop - .endm - - comment "crt0 startup" - .macro gdbasm_startup - ldi fp,#0 - .endm diff --git a/gdb/testsuite/gdb.base/bigcore.c b/gdb/testsuite/gdb.base/bigcore.c index 9215b5a..2a8bb07 100644 --- a/gdb/testsuite/gdb.base/bigcore.c +++ b/gdb/testsuite/gdb.base/bigcore.c @@ -19,14 +19,9 @@ Please email any bugs, comments, and/or additions to this file to: bug-gdb@prep.ai.mit.edu */ -/* Get 64-bit stuff if on a GNU system. */ -#define _GNU_SOURCE - #include <sys/types.h> #include <sys/time.h> #include <sys/resource.h> -#include <sys/stat.h> -#include <fcntl.h> #include <stdlib.h> #include <unistd.h> @@ -48,7 +43,7 @@ print_char (char c) } static void -print_unsigned (unsigned long long u) +print_unsigned (unsigned long u) { if (u >= 10) print_unsigned (u / 10); @@ -56,7 +51,7 @@ print_unsigned (unsigned long long u) } static void -print_hex (unsigned long long u) +print_hex (unsigned long u) { if (u >= 16) print_hex (u / 16); @@ -77,16 +72,6 @@ print_address (const void *a) print_hex ((unsigned long) a); } -static void -print_byte_count (unsigned long long u) -{ - print_unsigned (u); - print_string (" ("); - print_string ("0x"); - print_hex (u); - print_string (") bytes"); -} - /* Print the current values of RESOURCE. */ static void @@ -137,20 +122,10 @@ static struct list heap = { &dummy, &dummy }; static unsigned long bytes_allocated; -#ifdef O_LARGEFILE -#define large_off_t off64_t -#define large_lseek lseek64 -#else -#define large_off_t off_t -#define O_LARGEFILE 0 -#define large_lseek lseek -#endif - int main () { size_t max_chunk_size; - large_off_t max_core_size; /* Try to expand all the resource limits beyond the point of sanity - we're after the biggest possible core file. */ @@ -169,46 +144,14 @@ main () maximize_rlimit (RLIMIT_AS, "stack"); #endif - print_string ("Maximize allocation limits ...\n"); - - /* Compute the largest possible corefile size. No point in trying - to create a corefile larger than the largest file supported by - the file system. What about 64-bit lseek64? */ - { - int fd; - large_off_t tmp; - unlink ("bigcore.corefile"); - fd = open ("bigcore.corefile", O_RDWR | O_CREAT | O_TRUNC | O_LARGEFILE); - for (tmp = 1; tmp > 0; tmp <<= 1) - { - if (large_lseek (fd, tmp, SEEK_SET) > 0) - max_core_size = tmp; - } - close (fd); - } - /* Compute an initial chunk size. The math is dodgy but it works - for the moment. Perhaphs there's a constant around somewhere. - Limit this to max_core_size bytes - no point in trying to - allocate more than can be written to the corefile. */ + for the moment. Perhaphs there's a constant around somewhere. */ { size_t tmp; - for (tmp = 1; tmp > 0 && tmp < max_core_size; tmp <<= 1) + for (tmp = 1; tmp > 0; tmp <<= 1) max_chunk_size = tmp; } - print_string (" core: "); - print_byte_count (max_core_size); - print_string ("\n"); - print_string (" chunk: "); - print_byte_count (max_chunk_size); - print_string ("\n"); - print_string (" large? "); - if (O_LARGEFILE) - print_string ("yes\n"); - else - print_string ("no\n"); - /* Allocate as much memory as possible creating a linked list of each section. The linking ensures that some, but not all, the memory is allocated. NB: Some kernels handle this efficiently - @@ -230,10 +173,9 @@ main () { unsigned long count = 0; print_string (" "); - print_byte_count (chunk_size); - print_string (" ... "); - while (bytes_allocated + (1 + count) * chunk_size - < max_core_size) + print_unsigned (chunk_size); + print_string (" bytes ... "); + while (1) { struct list *chunk = malloc (chunk_size); if (chunk == NULL) @@ -252,7 +194,7 @@ main () bytes_allocated += chunk_size * count; } print_string ("Total of "); - print_byte_count (bytes_allocated); + print_unsigned (bytes_allocated); print_string (" bytes "); print_unsigned (chunks_allocated); print_string (" chunks\n"); diff --git a/gdb/testsuite/gdb.base/bigcore.exp b/gdb/testsuite/gdb.base/bigcore.exp index af3098c..b720136 100644 --- a/gdb/testsuite/gdb.base/bigcore.exp +++ b/gdb/testsuite/gdb.base/bigcore.exp @@ -49,13 +49,6 @@ if { [istarget "*-*-*bsd*"] return } -# This testcase causes too much stress (in terms of memory usage) -# on certain systems... -if { [istarget "*-*-*irix*"] } { - untested "Testcase too stressful for this system" - return -} - set testfile "bigcore" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} @@ -65,6 +58,36 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } +# Create a core file named "TESTFILE.corefile" rather than just +# "core", to avoid problems with sys admin types that like to +# regularly prune all files named "core" from the system. + +# Some systems append "core" to the name of the program; others append +# the name of the program to "core"; still others (like Linux, as of +# May 2003) create cores named "core.PID". In the latter case, we +# could have many core files lying around, and it may be difficult to +# tell which one is ours, so let's run the program in a subdirectory. + +set found 0 +set coredir "${objdir}/${subdir}/coredir.[getpid]" +file mkdir $coredir +catch "system \"(cd ${coredir}; ${binfile}; true) >/dev/null 2>&1\"" +set names [glob -nocomplain -directory $coredir *core*] +if {[llength $names] == 1} { + set file [file join $coredir [lindex $names 0]] + remote_exec build "mv $file $corefile" + set found 1 +} + +# Try to clean up after ourselves. +remote_file build delete [file join $coredir coremmap.data] +remote_exec build "rmdir $coredir" + +if { $found == 0 } { + warning "can't generate a core file - core tests suppressed - check ulimit -c" + return 0 +} + # Run GDB on the bigcore program up-to where it will dump core. gdb_exit @@ -83,6 +106,28 @@ gdb_test "tbreak $print_core_line" gdb_test continue ".*print_string.*" gdb_test next ".*0 = 0.*" +# Check that the corefile is plausibly large enough. We're trying to +# detect the case where the operating system has truncated the file +# just before signed wraparound. TCL, unfortunately, has a similar +# problem - so use catch. It can handle the "bad" size but not necessarily +# the "good" one. And we must use GDB for the comparison, similarly. + +if {[catch {file size $corefile} core_size] == 0} { + set core_ok 0 + gdb_test_multiple "print bytes_allocated < $core_size" "check core size" { + -re " = 1\r\n$gdb_prompt $" { + pass "check core size" + set core_ok 1 + } + -re " = 0\r\n$gdb_prompt $" { + xfail "check core size (system does not support large corefiles)" + } + } + if {$core_ok == 0} { + return 0 + } +} + # Traverse part of bigcore's linked list of memory chunks (forward or # backward), saving each chunk's address. @@ -118,79 +163,6 @@ proc extract_heap { dir } { set next_heap [extract_heap next] set prev_heap [extract_heap prev] -# Now create a core dump - -# Rename the core file to "TESTFILE.corefile" rather than just "core", -# to avoid problems with sys admin types that like to regularly prune -# all files named "core" from the system. - -# Some systems append "core" to the name of the program; others append -# the name of the program to "core"; still others (like Linux, as of -# May 2003) create cores named "core.PID". - -# Save the process ID. Some systems dump the core into core.PID. -set test "grab pid" -gdb_test_multiple "info program" $test { - -re "child process (\[0-9\]+).*$gdb_prompt $" { - set inferior_pid $expect_out(1,string) - pass $test - } - -re "$gdb_prompt $" { - set inferior_pid unknown - pass $test - } -} - -# Dump core using SIGABRT -set oldtimeout $timeout -set timeout 600 -gdb_test "signal SIGABRT" "Program terminated with signal SIGABRT, .*" - -# Find the corefile -set file "" -foreach pat [list core.${inferior_pid} ${testfile}.core core] { - set names [glob -nocomplain $pat] - if {[llength $names] == 1} { - set file [lindex $names 0] - remote_exec build "mv $file $corefile" - break - } -} - -if { $file == "" } { - untested "Can't generate a core file" - return 0 -} - -# Check that the corefile is plausibly large enough. We're trying to -# detect the case where the operating system has truncated the file -# just before signed wraparound. TCL, unfortunately, has a similar -# problem - so use catch. It can handle the "bad" size but not -# necessarily the "good" one. And we must use GDB for the comparison, -# similarly. - -if {[catch {file size $corefile} core_size] == 0} { - set core_ok 0 - gdb_test_multiple "print bytes_allocated < $core_size" "check core size" { - -re " = 1\r\n$gdb_prompt $" { - pass "check core size" - set core_ok 1 - } - } -} { - # Probably failed due to the TCL build having problems with very - # large values. Since GDB uses a 64-bit off_t (when possible) it - # shouldn't have this problem. Assume that things are going to - # work. Without this assumption the test is skiped on systems - # (such as i386 GNU/Linux with patched kernel) which do pass. - pass "check core size" - set core_ok 1 -} -if {! $core_ok} { - untested "check core size (system does not support large corefiles)" - return 0 -} - # Now load up that core file set test "load corefile" diff --git a/gdb/testsuite/gdb.base/constvars.exp b/gdb/testsuite/gdb.base/constvars.exp index 25f7434..6873286 100644 --- a/gdb/testsuite/gdb.base/constvars.exp +++ b/gdb/testsuite/gdb.base/constvars.exp @@ -15,6 +15,9 @@ # along with this program; if not, write to the Free Software # 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 + # written by Elena Zannoni (elz@apollo.hp.com) # # This file is part of the gdb testsuite @@ -65,9 +68,6 @@ if ![runto_main] then { get_debug_format -# Many tests xfail with gcc 2 -gstabs+. -# TODO: check out the hp side of this. - proc local_compiler_xfail_check { } { if { [test_compiler_info gcc-2-*] } then { if { ![test_debug_format "HP"] \ @@ -82,16 +82,6 @@ proc local_compiler_xfail_check { } { } } -# A few tests still xfail with gcc 3 -gstabs+ and gcc 4 -gstabs+. - -proc local_compiler_xfail_check_2 { } { - if { [test_compiler_info gcc-3-*] || [test_compiler_info gcc-4-*] } { - if { [test_debug_format "stabs" ] } { - setup_xfail "*-*-*" - } - } -} - send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $" send_gdb "cont\n" @@ -128,8 +118,10 @@ send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $" # test function parameters local_compiler_xfail_check -local_compiler_xfail_check_2 - +if { [test_compiler_info gcc-3-*] && [test_debug_format "stabs"] } then { + # With stabs, even GCC 3 does not get the const char arguments correct. + setup_xfail "*-*-*" +} send_gdb "ptype qux1\n" gdb_expect { -re "type = int \\(const char, const char, const char \\*, char \\* const\\).*$gdb_prompt $" { @@ -281,7 +273,11 @@ proc do_constvar_tests {} { gdb_test "ptype locust" "type = double \\* const" local_compiler_xfail_check - local_compiler_xfail_check_2 + if { [test_compiler_info gcc-3-*] && [test_debug_format "stabs"] } then { + # With stabs, even GCC 3 does not get the constant structure member + # correct. + setup_xfail "*-*-*" + } gdb_test "ptype crass" "type = struct crass \{\[\r\n\]+\[\ \t\]+char \\* const ptr;\[\r\n\]+\}" local_compiler_xfail_check gdb_test "ptype crisp" "type = struct crisp \{\[\r\n\]+\[\ \t\]+char \\* const \\*ptr;\[\r\n\]+\}" diff --git a/gdb/testsuite/gdb.base/overlays.exp b/gdb/testsuite/gdb.base/overlays.exp index 671eab5..37bfbaa 100644 --- a/gdb/testsuite/gdb.base/overlays.exp +++ b/gdb/testsuite/gdb.base/overlays.exp @@ -1,4 +1,4 @@ -# Copyright 1997, 1998, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# Copyright 1997, 1998, 2001, 2002, 2003 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 @@ -39,11 +39,6 @@ if [istarget "d10v-*-*"] then { return } -if [istarget "*-*-linux*"] then { - verbose "Skipping overlay test -- Linux doesn't support overlayed programs." - return -} - set testfile "overlays" set binfile ${objdir}/${subdir}/${testfile} set srcfile ${testfile}.c diff --git a/gdb/testsuite/gdb.base/sigstep.exp b/gdb/testsuite/gdb.base/sigstep.exp index 81f8eed..55de445 100644 --- a/gdb/testsuite/gdb.base/sigstep.exp +++ b/gdb/testsuite/gdb.base/sigstep.exp @@ -211,12 +211,12 @@ proc skip_to_handler { i } { set prefix "$i to handler" # Run around to the done - # You can add more patterns to this if you need them. set test "$prefix; resync" gdb_test_multiple "continue" "$test" { -re "done = 0.*$gdb_prompt " { pass "$test" } + # other patterns can go here } # Advance to the infinite loop @@ -252,12 +252,12 @@ proc skip_to_handler_entry { i } { set prefix "$i to handler entry" # Run around to the done - # You can add more patterns to this if you need them. set test "$prefix; resync" gdb_test_multiple "continue" "$test" { -re "done = 0.*$gdb_prompt " { pass "$test" } + # other patterns can go here } # Advance to the infinite loop @@ -285,12 +285,12 @@ proc skip_over_handler { i } { set prefix "$i over handler" # Run around to the done - # You can add more patterns to this if you need them. set test "$prefix; resync" gdb_test_multiple "continue" "$test" { -re "done = 0.*$gdb_prompt " { pass "$test" } + # other patterns can go here } # Advance to the infinite loop @@ -316,12 +316,12 @@ proc breakpoint_to_handler { i } { set prefix "$i on breakpoint, to handler" # Run around to the done - # You can add more patterns to this if you need them. set test "$prefix; resync" gdb_test_multiple "continue" "$test" { -re "done = 0.*$gdb_prompt " { pass "$test" } + # other patterns can go here } gdb_test "break $infinite_loop" "" "$prefix; break infinite loop" @@ -361,12 +361,12 @@ proc breakpoint_to_handler_entry { i } { set prefix "$i on breakpoint, to handler entry" # Run around to the done - # You can add more patterns to this if you need them. set test "$prefix; resync" gdb_test_multiple "continue" "$test" { -re "done = 0.*$gdb_prompt " { pass "$test" } + # other patterns can go here } gdb_test "break $infinite_loop" "" "$prefix; break infinite loop" @@ -398,12 +398,12 @@ proc breakpoint_over_handler { i } { set prefix "$i on breakpoint, skip handler" # Run around to the done - # You can add more patterns to this if you need them. set test "$prefix; resync" gdb_test_multiple "continue" "$test" { -re "done = 0.*$gdb_prompt " { pass "$test" } + # other patterns can go here } gdb_test "break $infinite_loop" "" "$prefix; break infinite loop" diff --git a/gdb/testsuite/gdb.base/volatile.exp b/gdb/testsuite/gdb.base/volatile.exp index b6623f8..c12e3d8 100644 --- a/gdb/testsuite/gdb.base/volatile.exp +++ b/gdb/testsuite/gdb.base/volatile.exp @@ -14,6 +14,9 @@ # along with this program; if not, write to the Free Software # 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 + # Written by Satish Pai <pai@apollo.hp.com> 1997-07-07 # In the spirit of constvars.exp: added volatile, const-volatile stuff. @@ -71,9 +74,6 @@ if ![runto_main] then { get_debug_format -# Many tests xfail with gcc 2 -gstabs+. -# TODO: check out the hp side of this. - proc local_compiler_xfail_check { } { if { [test_compiler_info gcc-2-*] } then { if { ![test_debug_format "HP"] \ @@ -88,16 +88,6 @@ proc local_compiler_xfail_check { } { } } -# A few tests still xfail with gcc 3 -gstabs+ and gcc 4 -gstabs+. - -proc local_compiler_xfail_check_2 { } { - if { [test_compiler_info gcc-3-*] || [test_compiler_info gcc-4-*] } { - if { [test_debug_format "stabs" ] } { - setup_xfail "*-*-*" - } - } -} - send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $" send_gdb "cont\n" @@ -258,7 +248,11 @@ gdb_test "ptype vendor" "type = const volatile unsigned char \\* const volatile. # test function parameters local_compiler_xfail_check -local_compiler_xfail_check_2 +if { [test_compiler_info gcc-3-*] && [test_debug_format "stabs"] } then { + # For reasons unknown, GCC 3 with stabs mangles several cv-qualified + # arguments to this function. + setup_xfail "*-*-*" +} send_gdb "ptype qux2\n" gdb_expect { -re "type = int \\(volatile unsigned char, const volatile int, volatile short( int)?, volatile long( int)? \\*, float \\* volatile, const volatile signed char \\* const volatile\\).*$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.dwarf2/Makefile.in b/gdb/testsuite/gdb.dwarf2/Makefile.in deleted file mode 100644 index c338e02..0000000 --- a/gdb/testsuite/gdb.dwarf2/Makefile.in +++ /dev/null @@ -1,38 +0,0 @@ -# Makefile for regression testing the GNU debugger. -# Copyright 1992, 1993, 1994, 1995, 1996, 1999, 2001, 2003, 2004 -# Free Software Foundation, Inc. - -# This file is part of GDB. - -# GDB is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# GDB is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# 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. - -VPATH = @srcdir@ -srcdir = @srcdir@ - -EXECUTABLES = *.x - -all info install-info dvi install uninstall installcheck check: - @echo "Nothing to be done for $@..." - -clean mostlyclean: - -rm -f *~ *.o a.out *.x *.ci *.tmp - -rm -f core core.coremaker coremaker.core corefile - -rm -f $(EXECUTABLES) - -distclean maintainer-clean realclean: clean - -rm -f *~ core - -rm -f Makefile config.status config.log - -rm -f *-init.exp - -rm -fr *.log summary detail *.plog *.sum *.psum site.* diff --git a/gdb/testsuite/gdb.dwarf2/dw2-basic.S b/gdb/testsuite/gdb.dwarf2/dw2-basic.S deleted file mode 100644 index 1e98a4d..0000000 --- a/gdb/testsuite/gdb.dwarf2/dw2-basic.S +++ /dev/null @@ -1,201 +0,0 @@ -/* This testcase is part of GDB, the GNU debugger. - - Copyright 2004 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 - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - 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. */ - -/* Test a minimal file containing DWARF-2 information. This test also - serves as a skeleton for other DWARF-2 tests. Most other tests will - not be this extensively itemized and commented... */ - -/* Dummy function to provide debug information for. */ - - .text -.Lbegin_text1: - .globl func_cu1 - .type func_cu1, %function -func_cu1: -.Lbegin_func_cu1: - .int 0 -.Lend_func_cu1: - .size func_cu1, .-func_cu1 -.Lend_text1: - -/* Debug information */ - - .section .debug_info -.Lcu1_begin: - /* CU header */ - .int .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */ -.Lcu1_start: - .short 2 /* DWARF Version */ - .int .Labbrev1_begin /* Offset into abbrev section */ - .byte 4 /* Pointer size */ - - /* CU die */ - .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ - .int .Lline1_begin /* DW_AT_stmt_list */ - .int .Lend_text1 /* DW_AT_high_pc */ - .int .Lbegin_text1 /* DW_AT_low_pc */ - .ascii "file1.txt\0" /* DW_AT_name */ - .ascii "GNU C 3.3.3\0" /* DW_AT_producer */ - .byte 1 /* DW_AT_language (C) */ - - /* func_cu1 */ - .uleb128 2 /* Abbrev: DW_TAG_subprogram */ - .byte 1 /* DW_AT_external */ - .byte 1 /* DW_AT_decl_file */ - .byte 2 /* DW_AT_decl_line */ - .ascii "func_cu1\0" /* DW_AT_name */ - .int .Ltype_int-.Lcu1_begin /* DW_AT_type */ - .int .Lbegin_func_cu1 /* DW_AT_low_pc */ - .int .Lend_func_cu1 /* DW_AT_high_pc */ - .byte 1 /* DW_AT_frame_base: length */ - .byte 0x55 /* DW_AT_frame_base: DW_OP_reg5 */ - -.Ltype_int: - .uleb128 3 /* Abbrev: DW_TAG_base_type */ - .ascii "int\0" /* DW_AT_name */ - .byte 4 /* DW_AT_byte_size */ - .byte 5 /* DW_AT_encoding */ - - .byte 0 /* End of children of CU */ - -.Lcu1_end: - -/* Abbrev table */ - .section .debug_abbrev -.Labbrev1_begin: - .uleb128 1 /* Abbrev code */ - .uleb128 0x11 /* DW_TAG_compile_unit */ - .byte 1 /* has_children */ - .uleb128 0x10 /* DW_AT_stmt_list */ - .uleb128 0x6 /* DW_FORM_data4 */ - .uleb128 0x12 /* DW_AT_high_pc */ - .uleb128 0x1 /* DW_FORM_addr */ - .uleb128 0x11 /* DW_AT_low_pc */ - .uleb128 0x1 /* DW_FORM_addr */ - .uleb128 0x3 /* DW_AT_name */ - .uleb128 0x8 /* DW_FORM_string */ - .uleb128 0x25 /* DW_AT_producer */ - .uleb128 0x8 /* DW_FORM_string */ - .uleb128 0x13 /* DW_AT_language */ - .uleb128 0xb /* DW_FORM_data1 */ - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ - - .uleb128 2 /* Abbrev code */ - .uleb128 0x2e /* DW_TAG_subprogram */ - .byte 0 /* has_children */ - .uleb128 0x3f /* DW_AT_external */ - .uleb128 0xc /* DW_FORM_flag */ - .uleb128 0x3a /* DW_AT_decl_file */ - .uleb128 0xb /* DW_FORM_data1 */ - .uleb128 0x3b /* DW_AT_decl_line */ - .uleb128 0xb /* DW_FORM_data1 */ - .uleb128 0x3 /* DW_AT_name */ - .uleb128 0x8 /* DW_FORM_string */ - .uleb128 0x49 /* DW_AT_type */ - .uleb128 0x13 /* DW_FORM_ref4 */ - .uleb128 0x11 /* DW_AT_low_pc */ - .uleb128 0x1 /* DW_FORM_addr */ - .uleb128 0x12 /* DW_AT_high_pc */ - .uleb128 0x1 /* DW_FORM_addr */ - .uleb128 0x40 /* DW_AT_frame_base */ - .uleb128 0xa /* DW_FORM_block1 */ - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ - - .uleb128 3 /* Abbrev code */ - .uleb128 0x24 /* DW_TAG_base_type */ - .byte 0 /* has_children */ - .uleb128 0x3 /* DW_AT_name */ - .uleb128 0x8 /* DW_FORM_string */ - .uleb128 0xb /* DW_AT_byte_size */ - .uleb128 0xb /* DW_FORM_data1 */ - .uleb128 0x3e /* DW_AT_encoding */ - .uleb128 0xb /* DW_FORM_data1 */ - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ - -/* Line table */ - .section .debug_line -.Lline1_begin: - .int .Lline1_end - .Lline1_start /* Initial length */ -.Lline1_start: - .short 2 /* Version */ - .int .Lline1_lines - .Lline1_hdr /* header_length */ -.Lline1_hdr: - .byte 1 /* Minimum insn length */ - .byte 1 /* default_is_stmt */ - .byte 1 /* line_base */ - .byte 1 /* line_range */ - .byte 0x10 /* opcode_base */ - - /* Standard lengths */ - .byte 0 - .byte 1 - .byte 1 - .byte 1 - .byte 1 - .byte 0 - .byte 0 - .byte 0 - .byte 1 - .byte 0 - .byte 0 - .byte 1 - .byte 0 - .byte 0 - .byte 0 - - /* Include directories */ - .byte 0 - - /* File names */ - .ascii "file1.txt\0" - .uleb128 0 - .uleb128 0 - .uleb128 0 - - .byte 0 - -.Lline1_lines: - .byte 0 /* DW_LNE_set_address */ - .uleb128 5 - .byte 2 - .int .Lbegin_func_cu1 - - .byte 3 /* DW_LNS_advance_line */ - .sleb128 3 /* ... to 4 */ - - .byte 1 /* DW_LNS_copy */ - - .byte 1 /* DW_LNS_copy (second time as an end-of-prologue marker) */ - - .byte 0 /* DW_LNE_set_address */ - .uleb128 5 - .byte 2 - .int .Lend_func_cu1 - - .byte 0 /* DW_LNE_end_of_sequence */ - .uleb128 1 - .byte 1 - -.Lline1_end: diff --git a/gdb/testsuite/gdb.dwarf2/dw2-basic.exp b/gdb/testsuite/gdb.dwarf2/dw2-basic.exp deleted file mode 100644 index 7e0611e..0000000 --- a/gdb/testsuite/gdb.dwarf2/dw2-basic.exp +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2004 -# 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# 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. - -# Minimal DWARF-2 unit test - -# This test can only be run on targets which support DWARF-2 and use gas. -# For now pick a sampling of likely targets. -if {![istarget *-*-linux*] - && ![istarget *-*-gnu*] - && ![istarget *-*-elf*] - && ![istarget arm-*-eabi*] - && ![istarget powerpc-*-eabi*]} { - return 0 -} - -set testfile "dw2-basic" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x - -if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { - return -1 -} - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } { - return -1 -} - -if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } { - return -1 -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - -gdb_test "set listsize 1" "" -gdb_test "list func_cu1" "4\tFile 1 Line 4" -gdb_test "ptype func_cu1" "type = int \\(\\)" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intercu.S b/gdb/testsuite/gdb.dwarf2/dw2-intercu.S deleted file mode 100644 index b612f85..0000000 --- a/gdb/testsuite/gdb.dwarf2/dw2-intercu.S +++ /dev/null @@ -1,236 +0,0 @@ -/* This testcase is part of GDB, the GNU debugger. - - Copyright 2004 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 - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - 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. */ - -/* Test a minimal file containing DWARF-2 information. This test also - serves as a skeleton for other DWARF-2 tests. Most other tests will - not be this extensively itemized and commented... */ - -/* Dummy function to provide debug information for. */ - - .text -.Lbegin_text1: - .globl func_cu1 - .type func_cu1, %function -func_cu1: -.Lbegin_func_cu1: - .int 0 -.Lend_func_cu1: - .size func_cu1, .-func_cu1 -.Lend_text1: - -/* Debug information */ - - .section .debug_info -.Lcu1_begin: - /* CU header */ - .int .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */ -.Lcu1_start: - .short 2 /* DWARF Version */ - .int .Labbrev1_begin /* Offset into abbrev section */ - .byte 4 /* Pointer size */ - - /* CU die */ - .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ - .int .Lline1_begin /* DW_AT_stmt_list */ - .int .Lend_text1 /* DW_AT_high_pc */ - .int .Lbegin_text1 /* DW_AT_low_pc */ - .ascii "file1.txt\0" /* DW_AT_name */ - .ascii "GNU C 3.3.3\0" /* DW_AT_producer */ - .byte 1 /* DW_AT_language (C) */ - - /* func_cu1 */ - .uleb128 2 /* Abbrev: DW_TAG_subprogram */ - .byte 1 /* DW_AT_external */ - .byte 1 /* DW_AT_decl_file */ - .byte 2 /* DW_AT_decl_line */ - .ascii "func_cu1\0" /* DW_AT_name */ - .int .Ltype_int /* DW_AT_type */ - .int .Lbegin_func_cu1 /* DW_AT_low_pc */ - .int .Lend_func_cu1 /* DW_AT_high_pc */ - .byte 1 /* DW_AT_frame_base: length */ - .byte 0x55 /* DW_AT_frame_base: DW_OP_reg5 */ - - .byte 0 /* End of children of CU */ - -.Lcu1_end: - - /* Second compilation unit. */ -.Lcu2_begin: - /* CU header */ - .int .Lcu2_end - .Lcu2_start /* Length of Compilation Unit */ -.Lcu2_start: - .short 2 /* DWARF Version */ - .int .Labbrev2_begin /* Offset into abbrev section */ - .byte 4 /* Pointer size */ - - /* CU die */ - .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ - .ascii "file1.txt\0" /* DW_AT_name */ - .ascii "GNU C 3.3.3\0" /* DW_AT_producer */ - .byte 1 /* DW_AT_language (C) */ - -.Ltype_int: - .uleb128 2 /* Abbrev: DW_TAG_base_type */ - .ascii "int\0" /* DW_AT_name */ - .byte 4 /* DW_AT_byte_size */ - .byte 5 /* DW_AT_encoding */ - - .byte 0 /* End of children of CU */ - -.Lcu2_end: - -/* Abbrev table */ - .section .debug_abbrev -.Labbrev1_begin: - .uleb128 1 /* Abbrev code */ - .uleb128 0x11 /* DW_TAG_compile_unit */ - .byte 1 /* has_children */ - .uleb128 0x10 /* DW_AT_stmt_list */ - .uleb128 0x6 /* DW_FORM_data4 */ - .uleb128 0x12 /* DW_AT_high_pc */ - .uleb128 0x1 /* DW_FORM_addr */ - .uleb128 0x11 /* DW_AT_low_pc */ - .uleb128 0x1 /* DW_FORM_addr */ - .uleb128 0x3 /* DW_AT_name */ - .uleb128 0x8 /* DW_FORM_string */ - .uleb128 0x25 /* DW_AT_producer */ - .uleb128 0x8 /* DW_FORM_string */ - .uleb128 0x13 /* DW_AT_language */ - .uleb128 0xb /* DW_FORM_data1 */ - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ - - .uleb128 2 /* Abbrev code */ - .uleb128 0x2e /* DW_TAG_subprogram */ - .byte 0 /* has_children */ - .uleb128 0x3f /* DW_AT_external */ - .uleb128 0xc /* DW_FORM_flag */ - .uleb128 0x3a /* DW_AT_decl_file */ - .uleb128 0xb /* DW_FORM_data1 */ - .uleb128 0x3b /* DW_AT_decl_line */ - .uleb128 0xb /* DW_FORM_data1 */ - .uleb128 0x3 /* DW_AT_name */ - .uleb128 0x8 /* DW_FORM_string */ - .uleb128 0x49 /* DW_AT_type */ - .uleb128 0x10 /* DW_FORM_ref_addr */ - .uleb128 0x11 /* DW_AT_low_pc */ - .uleb128 0x1 /* DW_FORM_addr */ - .uleb128 0x12 /* DW_AT_high_pc */ - .uleb128 0x1 /* DW_FORM_addr */ - .uleb128 0x40 /* DW_AT_frame_base */ - .uleb128 0xa /* DW_FORM_block1 */ - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ - -.Labbrev2_begin: - .uleb128 1 /* Abbrev code */ - .uleb128 0x11 /* DW_TAG_compile_unit */ - .byte 1 /* has_children */ - .uleb128 0x3 /* DW_AT_name */ - .uleb128 0x8 /* DW_FORM_string */ - .uleb128 0x25 /* DW_AT_producer */ - .uleb128 0x8 /* DW_FORM_string */ - .uleb128 0x13 /* DW_AT_language */ - .uleb128 0xb /* DW_FORM_data1 */ - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ - - .uleb128 2 /* Abbrev code */ - .uleb128 0x24 /* DW_TAG_base_type */ - .byte 0 /* has_children */ - .uleb128 0x3 /* DW_AT_name */ - .uleb128 0x8 /* DW_FORM_string */ - .uleb128 0xb /* DW_AT_byte_size */ - .uleb128 0xb /* DW_FORM_data1 */ - .uleb128 0x3e /* DW_AT_encoding */ - .uleb128 0xb /* DW_FORM_data1 */ - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ - -/* Line table */ - .section .debug_line -.Lline1_begin: - .int .Lline1_end - .Lline1_start /* Initial length */ -.Lline1_start: - .short 2 /* Version */ - .int .Lline1_lines - .Lline1_hdr /* header_length */ -.Lline1_hdr: - .byte 1 /* Minimum insn length */ - .byte 1 /* default_is_stmt */ - .byte 1 /* line_base */ - .byte 1 /* line_range */ - .byte 0x10 /* opcode_base */ - - /* Standard lengths */ - .byte 0 - .byte 1 - .byte 1 - .byte 1 - .byte 1 - .byte 0 - .byte 0 - .byte 0 - .byte 1 - .byte 0 - .byte 0 - .byte 1 - .byte 0 - .byte 0 - .byte 0 - - /* Include directories */ - .byte 0 - - /* File names */ - .ascii "file1.txt\0" - .uleb128 0 - .uleb128 0 - .uleb128 0 - - .byte 0 - -.Lline1_lines: - .byte 0 /* DW_LNE_set_address */ - .uleb128 5 - .byte 2 - .int .Lbegin_func_cu1 - - .byte 3 /* DW_LNS_advance_line */ - .sleb128 3 /* ... to 4 */ - - .byte 1 /* DW_LNS_copy */ - - .byte 1 /* DW_LNS_copy (second time as an end-of-prologue marker) */ - - .byte 0 /* DW_LNE_set_address */ - .uleb128 5 - .byte 2 - .int .Lend_func_cu1 - - .byte 0 /* DW_LNE_end_of_sequence */ - .uleb128 1 - .byte 1 - -.Lline1_end: diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp b/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp deleted file mode 100644 index d9a0cfd..0000000 --- a/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2004 -# 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# 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. - -# Minimal DWARF-2 unit test - -# This test can only be run on targets which support DWARF-2 and use gas. -# For now pick a sampling of likely targets. -if {![istarget *-*-linux*] - && ![istarget *-*-gnu*] - && ![istarget *-*-elf*] - && ![istarget arm-*-eabi*] - && ![istarget powerpc-*-eabi*]} { - return 0 -} - -set testfile "dw2-intercu" -set srcfile ${testfile}.S -set binfile ${objdir}/${subdir}/${testfile}.x - -if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } { - return -1 -} - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } { - return -1 -} - -if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } { - return -1 -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - -gdb_test "set listsize 1" "" -gdb_test "list func_cu1" "4\tFile 1 Line 4" -gdb_test "ptype func_cu1" "type = int \\(\\)" diff --git a/gdb/testsuite/gdb.dwarf2/file1.txt b/gdb/testsuite/gdb.dwarf2/file1.txt deleted file mode 100644 index b745e3a..0000000 --- a/gdb/testsuite/gdb.dwarf2/file1.txt +++ /dev/null @@ -1,8 +0,0 @@ -File 1 Line 1 -File 1 Line 2 -File 1 Line 3 -File 1 Line 4 -File 1 Line 5 -File 1 Line 6 -File 1 Line 7 -File 1 Line 8 diff --git a/gdb/testsuite/gdb.dwarf2/main.c b/gdb/testsuite/gdb.dwarf2/main.c deleted file mode 100644 index 87442ac..0000000 --- a/gdb/testsuite/gdb.dwarf2/main.c +++ /dev/null @@ -1,26 +0,0 @@ -/* This testcase is part of GDB, the GNU debugger. - - Copyright 2004 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 - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - 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. */ - -/* Dummy main function. */ - -int -main() -{ - return 0; -} diff --git a/gdb/testsuite/gdb.java/jprint.exp b/gdb/testsuite/gdb.java/jprint.exp deleted file mode 100644 index 0268f87..0000000 --- a/gdb/testsuite/gdb.java/jprint.exp +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright 2004 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# 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. - -# This file was written by Jeff Johnston. (jjohnstn@redhat.com) -# - -if $tracelevel then { - strace $tracelevel -} - -load_lib "java.exp" - -set testfile "jprint" -set srcfile ${srcdir}/$subdir/${testfile}.java -set binfile ${objdir}/${subdir}/${testfile} -if { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } { - untested "Couldn't compile ${srcfile}" - return -1 -} - -# Set the current language to java. This counts as a test. If it -# fails, then we skip the other tests. - -proc set_lang_java {} { - global gdb_prompt - global binfile objdir subdir - - verbose "loading file '$binfile'" - gdb_load $binfile - - send_gdb "set language java\n" - gdb_expect { - -re ".*$gdb_prompt $" {} - timeout { fail "set language java (timeout)" ; return 0 } - } - - return [gdb_test "show language" ".* source language is \"java\".*" \ - "set language to \"java\""] -} - -set prms_id 0 -set bug_id 0 - -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir - -gdb_test "set print sevenbit-strings" ".*" - -if ![set_lang_java] then { - # Ref PR gdb:java/1565. Don't use the simpler "break jmisc.main". - # As of 2004-02-24 it wasn't working and is being tested separatly. - runto "\'${testfile}.main(java.lang.String\[\])\'" - - gdb_test "p jvclass.addprint(4,5,6)" "sum is 15\r\n.*" "unambiguous static call" - - gdb_test "next" "" - gdb_test "next" "" - - gdb_test "p x.print(44)" "x is 44\r\n.*" "single argument print call" - gdb_test "p x.print(22,33)" "y is 33\r\n.*" "double argument print call" - gdb_test "call x.dothat(55)" "new value is 58\r\n.*= 62.*" "virtual fn call" - gdb_test "p x.addprint(1,2,3)" "sum is 6\r\n.*" "inherited static call" - gdb_test "call x.addk(44)" "adding k gives 121\r\n.*= 121.*" "inherited virtual fn call" -} diff --git a/gdb/testsuite/gdb.java/jprint.java b/gdb/testsuite/gdb.java/jprint.java deleted file mode 100644 index f17607e..0000000 --- a/gdb/testsuite/gdb.java/jprint.java +++ /dev/null @@ -1,62 +0,0 @@ -// jprint.java test program. -// -// Copyright 2004 -// Free Software Foundation, Inc. -// -// Written by Jeff Johnston <jjohnstn@redhat.com> -// Contributed by Red Hat -// -// This file is part of GDB. -// -// 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 -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// 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. - -class jvclass { - public static int k; - static { - k = 77; - } - public static void addprint (int x, int y, int z) { - int sum = x + y + z; - System.out.println ("sum is " + sum); - } - - public int addk (int x) { - int sum = x + k; - System.out.println ("adding k gives " + sum); - return sum; - } -} - -public class jprint extends jvclass { - public int dothat (int x) { - int y = x + 3; - System.out.println ("new value is " + y); - return y + 4; - } - public static void print (int x) { - System.out.println("x is " + x); - } - public static void print (int x, int y) { - System.out.println("y is " + y); - } - public static void main(String[] args) { - jprint x = new jprint (); - x.print (44); - print (k, 33); - } -} - - diff --git a/gdb/testsuite/gdb.mi/gdb701.c b/gdb/testsuite/gdb.mi/gdb701.c index b1e72d2..16e5c29 100644 --- a/gdb/testsuite/gdb.mi/gdb701.c +++ b/gdb/testsuite/gdb.mi/gdb701.c @@ -11,5 +11,5 @@ int main (int argc, char *argv[]) { Foo *foo = 0; - return 0; + exit (0); } diff --git a/gdb/testsuite/gdb.threads/bp_in_thread.exp b/gdb/testsuite/gdb.threads/bp_in_thread.exp index 91c3283..e9dfadb 100644 --- a/gdb/testsuite/gdb.threads/bp_in_thread.exp +++ b/gdb/testsuite/gdb.threads/bp_in_thread.exp @@ -35,16 +35,15 @@ gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -runto_main gdb_test "break noreturn" \ - "Breakpoint 2 at .*: file .*${srcfile}, line .*" \ + "Breakpoint 1 at .*: file .*${srcfile}, line .*" \ "breakpoint on noreturn" # Run the program and make sure GDB reports that we stopped after # hitting breakpoint 1 in noreturn(). -gdb_test "continue" \ - ".*Breakpoint 2, noreturn ().*" \ +gdb_test "run" \ + ".*Breakpoint 1, noreturn ().*" \ "run to noreturn" diff --git a/gdb/testsuite/gdb.threads/pthread_cond_wait.exp b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp index 91b695f..72ae03a 100644 --- a/gdb/testsuite/gdb.threads/pthread_cond_wait.exp +++ b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp @@ -36,14 +36,13 @@ gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -runto_main gdb_test "break break_me" \ - "Breakpoint 2 at .*: file .*${srcfile}, line .*" \ + "Breakpoint 1 at .*: file .*${srcfile}, line .*" \ "breakpoint on break_me" -gdb_test "continue" \ - ".*Breakpoint 2, break_me ().*" \ +gdb_test "run" \ + ".*Breakpoint 1, break_me ().*" \ "run to break_me" # diff --git a/gdb/testsuite/gdb.threads/watchthreads.c b/gdb/testsuite/gdb.threads/watchthreads.c deleted file mode 100644 index e19fe07..0000000 --- a/gdb/testsuite/gdb.threads/watchthreads.c +++ /dev/null @@ -1,66 +0,0 @@ -/* This testcase is part of GDB, the GNU debugger. - - Copyright 2002, 2003, 2004 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 - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - 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. - - This file is copied from schedlock.c. */ - -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include <pthread.h> - -void *thread_function(void *arg); /* Pointer to function executed by each thread */ - -#define NUM 5 - -unsigned int args[NUM+1]; - -int main() { - int res; - pthread_t threads[NUM]; - void *thread_result; - long i; - - for (i = 0; i < NUM; i++) - { - args[i] = 1; /* Init value. */ - res = pthread_create(&threads[i], - NULL, - thread_function, - (void *) i); - } - - args[i] = 1; - thread_function ((void *) i); - - exit(EXIT_SUCCESS); -} - -void *thread_function(void *arg) { - int my_number = (long) arg; - int *myp = (int *) &args[my_number]; - - /* Don't run forever. Run just short of it :) */ - while (*myp > 0) - { - (*myp) ++; /* Loop increment. */ - } - - pthread_exit(NULL); -} - diff --git a/gdb/testsuite/gdb.threads/watchthreads.exp b/gdb/testsuite/gdb.threads/watchthreads.exp index 0bb940f..d6e89d9 100644 --- a/gdb/testsuite/gdb.threads/watchthreads.exp +++ b/gdb/testsuite/gdb.threads/watchthreads.exp @@ -31,7 +31,7 @@ if [target_info exists gdb,no_hardware_watchpoints] { return 0; } -set testfile "watchthreads" +set testfile "schedlock" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } { @@ -60,20 +60,17 @@ set args_1 0 gdb_test "watch args\[0\]" "Hardware watchpoint 2: args\\\[0\\\]" gdb_test "watch args\[1\]" "Hardware watchpoint 3: args\\\[1\\\]" -set init_line [expr [gdb_get_line_number "Init value"]+1] -set inc_line [gdb_get_line_number "Loop increment"] - # Loop and continue to allow both watchpoints to be triggered. for {set i 0} {$i < 30} {incr i} { set test_flag 0 gdb_test_multiple "continue" "threaded watch loop" { - -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads.c:$init_line.*$gdb_prompt $" + -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*schedlock.c:21.*$gdb_prompt $" { set args_0 1; set test_flag 1 } - -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads.c:$init_line.*$gdb_prompt $" + -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*schedlock.c:21.*$gdb_prompt $" { set args_1 1; set test_flag 1 } - -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = $args_0.*New value = [expr $args_0+1].*in thread_function \\\(arg=0x0\\\) at .*watchthreads.c:$inc_line.*$gdb_prompt $" + -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = $args_0.*New value = [expr $args_0+1].*in thread_function \\\(arg=0x0\\\) at .*schedlock.c:42.*$gdb_prompt $" { set args_0 [expr $args_0+1]; set test_flag 1 } - -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = $args_1.*New value = [expr $args_1+1].*in thread_function \\\(arg=0x1\\\) at .*watchthreads.c:$inc_line.*$gdb_prompt $" + -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = $args_1.*New value = [expr $args_1+1].*in thread_function \\\(arg=0x1\\\) at .*schedlock.c:42.*$gdb_prompt $" { set args_1 [expr $args_1+1]; set test_flag 1 } } # If we fail above, don't bother continuing loop |