This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
cleanup some tests
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 09 Jun 2006 21:48:33 +0100
- Subject: cleanup some tests
This patch cleans up a number of spurious test failures I encountered
When using a remote stub to talk to a board, I found it necessary to run to
main, in order to syncronize the debugger correctly.
The remote.exp changes are obvious, when one looks at gdb's source.
The huge.exp test creates a large executable, and the initial attempt was too
big for the target board. The patch simply iterates the compilation until one
succeeds.
Finally, the m68k assembler doesn't use # for comments, so the mac-fileno.S
failed there. mac-fileno.S already uses /*..*/ comments in places, this patch
just makes it use it everywhere.
ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2006-06-09 Nathan Sidwell <nathan@codesourcery.com>
gdb/testsuite/
* gdb.base/cursal.exp: Run to main before setting listing
size.
* gdb.base/dbx.exp: Run to main before testing.
* gdb.base/ending-run.exp: Add additional expected string.
* gdb.base/huge.c: Allow CRASH_GDB to be set from command
line.
* gdb.base/huge.exp: Loop over compilation to find a size that
is acceptable.
* gdb.base/remote.exp: Correct expected strings.
* gdb.dwarf2/mac-fileno.S: Avoid # comments.
Index: gdb/testsuite/gdb.base/cursal.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/cursal.exp,v
retrieving revision 1.1
diff -c -3 -p -r1.1 cursal.exp
*** gdb/testsuite/gdb.base/cursal.exp 5 Nov 2004 08:52:28 -0000 1.1
--- gdb/testsuite/gdb.base/cursal.exp 9 Jun 2006 20:34:43 -0000
*************** gdb_exit
*** 35,43 ****
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
-
gdb_test "set listsize 1" \
".*"
# initial sal should be first statement in main
gdb_test "list" \
--- 35,44 ----
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
gdb_test "set listsize 1" \
".*"
+ gdb_test "break main" ".*Breakpoint.* at .*" "set breakpoint at main"
+ gdb_run_cmd
# initial sal should be first statement in main
gdb_test "list" \
Index: gdb/testsuite/gdb.base/dbx.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/dbx.exp,v
retrieving revision 1.4
diff -c -3 -p -r1.4 dbx.exp
*** gdb/testsuite/gdb.base/dbx.exp 30 Mar 2002 23:47:18 -0000 1.4
--- gdb/testsuite/gdb.base/dbx.exp 9 Jun 2006 20:34:43 -0000
*************** proc gdb_file_cmd {arg} {
*** 262,267 ****
--- 262,268 ----
#
proc test_breakpoints { } {
gdb_test "stop in main" "Breakpoint.*at.*: file.*average\.c, line 38\."
+ gdb_run_cmd
gdb_test "status" "Num.*Type.*Disp.*Enb.*Address.*What\r\n1\[ \r\]+breakpoint\[ \r\]+keep y.*in main at.*average\.c:38.*"
gdb_test "stop at 43" "Breakpoint.*at.*: file.*average\.c, line 43.*"
gdb_test "stop in 43" "Usage: stop in <function . address>"
Index: gdb/testsuite/gdb.base/ending-run.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ending-run.exp,v
retrieving revision 1.23.18.1
diff -c -3 -p -r1.23.18.1 ending-run.exp
*** gdb/testsuite/gdb.base/ending-run.exp 3 May 2006 17:54:32 -0000 1.23.18.1
--- gdb/testsuite/gdb.base/ending-run.exp 9 Jun 2006 20:34:43 -0000
*************** gdb_expect {
*** 235,240 ****
--- 235,243 ----
-re ".*in.*currently asm.*$gdb_prompt $" {
pass "step out of main (into assembler)"
}
+ -re "start \\(\\).*$gdb_prompt $" {
+ pass "step out of main"
+ }
-re ".*Program received signal SIGTRAP.*$gdb_prompt $" {
pass "Cygmon stopped in ending trap."
}
Index: gdb/testsuite/gdb.base/huge.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/huge.c,v
retrieving revision 1.3
diff -c -3 -p -r1.3 huge.c
*** gdb/testsuite/gdb.base/huge.c 24 Jan 2004 18:25:06 -0000 1.3
--- gdb/testsuite/gdb.base/huge.c 9 Jun 2006 20:34:43 -0000
***************
*** 7,15 ****
/* A value that will produce a target data object large enough to
crash GDB. 0x200000 is big enough on GNU/Linux, other systems may
need a larger number. */
!
#define CRASH_GDB 0x200000
!
static int a[CRASH_GDB], b[CRASH_GDB];
main()
--- 7,15 ----
/* A value that will produce a target data object large enough to
crash GDB. 0x200000 is big enough on GNU/Linux, other systems may
need a larger number. */
! #ifndef CRASH_GDB
#define CRASH_GDB 0x200000
! #endif
static int a[CRASH_GDB], b[CRASH_GDB];
main()
Index: gdb/testsuite/gdb.base/huge.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/huge.exp,v
retrieving revision 1.2
diff -c -3 -p -r1.2 huge.exp
*** gdb/testsuite/gdb.base/huge.exp 2 Feb 2004 05:15:27 -0000 1.2
--- gdb/testsuite/gdb.base/huge.exp 9 Jun 2006 20:34:43 -0000
*************** if [target_info exists gdb,skip_huge_tes
*** 36,42 ****
set testfile "huge"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
--- 36,48 ----
set testfile "huge"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
!
! for { set size [expr 2 * 1024 * 1024] } { $size > 10 } { set size [expr $size / 2] } {
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
! executable [list debug "additional_flags=-DCRASH_GDB=$size"]] \
! == "" } break
! }
! if { $size < 10 } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
Index: gdb/testsuite/gdb.base/remote.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/remote.exp,v
retrieving revision 1.5
diff -c -3 -p -r1.5 remote.exp
*** gdb/testsuite/gdb.base/remote.exp 10 Sep 2004 01:04:58 -0000 1.5
--- gdb/testsuite/gdb.base/remote.exp 9 Jun 2006 20:34:44 -0000
*************** if {$result != "" } then {
*** 47,53 ****
#
gdb_test "show download-write-size" \
! "The write size used when downloading a program is 512." \
"download limit default"
gdb_test "set download-write-size" "Argument required.*"
--- 47,53 ----
#
gdb_test "show download-write-size" \
! "The write size used when downloading a program is 16384." \
"download limit default"
gdb_test "set download-write-size" "Argument required.*"
*************** gdb_test "set remote memory-write-packet
*** 65,78 ****
"Argument required .integer, `fixed' or `limited'.\." \
"set write-packet - NULL"
! gdb_test "set remote memory-write-packet-size 16" ""
gdb_test "show remote memory-write-packet-size" \
! "The memory-write-packet-size is 16. Packets are limited to 16 bytes." \
"set write-packet - small"
gdb_test "set remote memory-write-packet-size 1" ""
gdb_test "show remote memory-write-packet-size" \
! "The memory-write-packet-size is 1. Packets are limited to 16 bytes." \
"set write-packet - very-small"
#
--- 65,78 ----
"Argument required .integer, `fixed' or `limited'.\." \
"set write-packet - NULL"
! gdb_test "set remote memory-write-packet-size 20" ""
gdb_test "show remote memory-write-packet-size" \
! "The memory-write-packet-size is 20. Packets are limited to 20 bytes." \
"set write-packet - small"
gdb_test "set remote memory-write-packet-size 1" ""
gdb_test "show remote memory-write-packet-size" \
! "The memory-write-packet-size is 1. Packets are limited to 20 bytes." \
"set write-packet - very-small"
#
*************** if {$sizeof_random_data > 16380 } then {
*** 191,197 ****
gdb_test "set remote memory-read-packet-size 16" \
""
gdb_test "show remote memory-read-packet-size" \
! "The memory-read-packet-size is 16. Packets are limited to 16 bytes."
gdb_test "x/17ub random_data" \
"<random_data>:\[ \t\]+60\[ \t\]+74\[ \t\]+216\[ \t\]+38\[ \t\]+149\[ \t\]+49\[ \t\]+207\[ \t\]+44.*<random_data\\+8>:\[ \t\]+124\[ \t\]+38\[ \t\]+93\[ \t\]+125\[ \t\]+232\[ \t\]+67\[ \t\]+228\[ \t\]+56.*<random_data\\+16>:\[ \t\]+161"
--- 191,197 ----
gdb_test "set remote memory-read-packet-size 16" \
""
gdb_test "show remote memory-read-packet-size" \
! "The memory-read-packet-size is 16. Packets are limited to 20 bytes."
gdb_test "x/17ub random_data" \
"<random_data>:\[ \t\]+60\[ \t\]+74\[ \t\]+216\[ \t\]+38\[ \t\]+149\[ \t\]+49\[ \t\]+207\[ \t\]+44.*<random_data\\+8>:\[ \t\]+124\[ \t\]+38\[ \t\]+93\[ \t\]+125\[ \t\]+232\[ \t\]+67\[ \t\]+228\[ \t\]+56.*<random_data\\+16>:\[ \t\]+161"
Index: gdb/testsuite/gdb.dwarf2/mac-fileno.S
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.dwarf2/mac-fileno.S,v
retrieving revision 1.1
diff -c -3 -p -r1.1 mac-fileno.S
*** gdb/testsuite/gdb.dwarf2/mac-fileno.S 4 Nov 2005 02:48:51 -0000 1.1
--- gdb/testsuite/gdb.dwarf2/mac-fileno.S 9 Jun 2006 20:34:44 -0000
*************** func_cu1:
*** 206,215 ****
.section .debug_macinfo,"",@progbits
.Ldebug_macinfo0:
! .byte 0x3 # Start new file
! .uleb128 0x0 # Included from line number 0
! .uleb128 0x2 # Filename we just started (bug: number too large)
! .byte 0x3 # Start new file
! .uleb128 0x0 # Included from line number 0
! .uleb128 0x0 # Filename we just started (bug: number too small)
! .byte 0x0 # end of CU's macro information
--- 206,215 ----
.section .debug_macinfo,"",@progbits
.Ldebug_macinfo0:
! .byte 0x3 /* Start new file */
! .uleb128 0x0 /* Included from line number 0 */
! .uleb128 0x2 /* Filename we just started (bug: number too large) */
! .byte 0x3 /* Start new file */
! .uleb128 0x0 /* Included from line number 0 */
! .uleb128 0x0 /* Filename we just started (bug: number too small) */
! .byte 0x0 /* end of CU's macro information */