This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[testsuite, commit+7.5] Fix various minor testsuite issues
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 2 Aug 2012 18:06:31 +0200 (CEST)
- Subject: [testsuite, commit+7.5] Fix various minor testsuite issues
Hello,
here's a miscellaneous set of small testsuite fixes:
- On SPU, annota1.exp would fail because we now get *no* frames-invalid
notification on startup at all, and the test expects at least one.
This seems to have changed due to us no longer invalidating the
register cache after a recent change, and it actually OK.
- A py-value.exp test displays a pointer having a small value (0x7)
-- but on the SPU, even that small value has a symbolic representation
as _init + 3, since _init usually lies at address 0x4 ...
- The server-exec-info.exp makes sense only on platforms supporting
shared libraries (also, like all gdbserver tests it ought to respect
[skip_gdbserver_tests]).
- Finally, linux-dp.exp uses global variable "seen" as an array while
other tests use the same variable as a scalar, which can cause Tcl
errors. Now, linux-dp.exp unsets "seen" before it uses it -- but
when running a multi-lib test, those other tests can again run after
linux-dp.exp, so linux-dp.exp ought to unset the variable *after*
it is done with it as well.
Tested on spu-elf, powerpc(64)-linux, s390(x)-linux, and arm-linux-gnueabi.
Committed to mainline and 7.5.
Bye,
Ulrich
ChangeLog:
* gdb.base/annota1.exp: Accept no frames-invalid notification
when starting up the program.
* gdb.python/py-value.exp (test_value_numeric_ops): Pointers may
show a symbolic value as well.
* gdb.server/server-exec-info.exp: Skip test when skipping
gdbserver test and/or when skipping shared library tests.
* gdb.threads/linux-dp.exp: Unset "seen" when done with it to
avoid name conflicts with other tests.
Index: gdb/testsuite/gdb.base/annota1.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/annota1.exp,v
retrieving revision 1.48.2.1
diff -u -p -r1.48.2.1 annota1.exp
--- gdb/testsuite/gdb.base/annota1.exp 27 Jul 2012 21:35:58 -0000 1.48.2.1
+++ gdb/testsuite/gdb.base/annota1.exp 2 Aug 2012 13:28:33 -0000
@@ -133,7 +133,7 @@ gdb_test_multiple "info break" "breakpoi
#exp_internal 1
set binexp [string_to_regexp $binfile]
gdb_test_multiple "run" "run until main breakpoint" {
- -re "\r\n\032\032post-prompt\r\nStarting program: $binexp \(\r\nwarning: Skipping \[^\r\n\]+ .gdb_index section in \[^\r\n\]+\r\nDo \"set use-deprecated-index-sections on\" before the file is read\r\nto use the section anyway\\.\)?\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)+\r\n\r\n\032\032starting\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota1.c\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped.*$gdb_prompt$" {
+ -re "\r\n\032\032post-prompt\r\nStarting program: $binexp \(\r\nwarning: Skipping \[^\r\n\]+ .gdb_index section in \[^\r\n\]+\r\nDo \"set use-deprecated-index-sections on\" before the file is read\r\nto use the section anyway\\.\)?\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n\032\032starting\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota1.c\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped.*$gdb_prompt$" {
pass "run until main breakpoint"
}
}
Index: gdb/testsuite/gdb.python/py-value.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-value.exp,v
retrieving revision 1.28
diff -u -p -r1.28 py-value.exp
--- gdb/testsuite/gdb.python/py-value.exp 22 Jun 2012 17:59:33 -0000 1.28
+++ gdb/testsuite/gdb.python/py-value.exp 2 Aug 2012 13:28:33 -0000
@@ -100,8 +100,8 @@ proc test_value_numeric_ops {} {
gdb_test "print (void *) 5" ".*" ""
gdb_test_no_output "python b = gdb.history (0)" ""
- gdb_test "python print 'result = ' + str(a+5)" " = 0x7" "add pointer value with python integer"
- gdb_test "python print 'result = ' + str(b-2)" " = 0x3" "subtract python integer from pointer value"
+ gdb_test "python print 'result = ' + str(a+5)" " = 0x7( <.*>)?" "add pointer value with python integer"
+ gdb_test "python print 'result = ' + str(b-2)" " = 0x3( <.*>)?" "subtract python integer from pointer value"
gdb_test "python print 'result = ' + str(b-a)" " = 3" "subtract two pointer values"
# Test some invalid operations.
Index: gdb/testsuite/gdb.server/server-exec-info.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.server/server-exec-info.exp,v
retrieving revision 1.2
diff -u -p -r1.2 server-exec-info.exp
--- gdb/testsuite/gdb.server/server-exec-info.exp 25 Jun 2012 19:46:26 -0000 1.2
+++ gdb/testsuite/gdb.server/server-exec-info.exp 2 Aug 2012 13:28:33 -0000
@@ -15,6 +15,13 @@
load_lib gdbserver-support.exp
+# We test for skip_shlib_tests in this test because without a main
+# exec file we only have the exec target loaded if shared libraries
+# are present.
+if {[skip_gdbserver_tests] || [skip_shlib_tests]} {
+ return
+}
+
standard_testfile server.c
if [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] {
return -1
Index: gdb/testsuite/gdb.threads/linux-dp.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/linux-dp.exp,v
retrieving revision 1.32
diff -u -p -r1.32 linux-dp.exp
--- gdb/testsuite/gdb.threads/linux-dp.exp 26 Jun 2012 19:23:20 -0000 1.32
+++ gdb/testsuite/gdb.threads/linux-dp.exp 2 Aug 2012 13:28:34 -0000
@@ -342,6 +342,7 @@ for {set i 1} {$i <= $nthreads} {incr i}
set any_interesting 1
}
}
+unset seen
if {$any_interesting} {
pass "found an interesting thread"
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com