[patch] gdb.base/valgrind-infcall.exp compat. with Ubuntu 10.04.4

Jan Kratochvil
2012-08-07T06:43:27Z

Hi Doug,

according to freenode #gdb

(2012-08-07 00:02:56 GMT)
xdje: jankratochvil: I'm seeing valgrind-infcall.exp failing. While the docs
for gdb_test_multiple claim the action is performed in the caller's context,
that doesn't appear to be the case ...
(2012-08-07 00:03:29 GMT)
xdje: ... and the "break" for finding "Invalid free" is a nop, and we take the
"Remote connection closed" exit.

It works on Fedora systems and also on Ubuntu 12.04.
On reported Ubuntu 10.04.4 the testcase quits early as UNSUPPORTED because
valgrind is too old there.
So I do not see how to test it, except for building custom valgrind there.

Does it work for you this way?

Thanks,
Jan

gdb/testsuite/
2012-08-07 Jan Kratochvil <jan.kratochvil@redhat.com>

* gdb.base/valgrind-infcall.exp (continue #$continue_count): Use
global variable loop, not a 'break'.

diff --git a/gdb/testsuite/gdb.base/valgrind-infcall.exp b/gdb/testsuite/gdb.base/valgrind-infcall.exp
index 3224e9c..526d82a 100644
--- a/gdb/testsuite/gdb.base/valgrind-infcall.exp
+++ b/gdb/testsuite/gdb.base/valgrind-infcall.exp
@@ -90,12 +90,14 @@ gdb_test "$vgdbcmd" " in \\.?_start .*" "target remote for vgdb"
gdb_test "monitor v.set gdb_output" "valgrind output will go to gdb.*"

set continue_count 1
-while 1 {
+set loop 1
+while {$loop} {
set test "continue #$continue_count"
gdb_test_multiple "continue" "" {
-re "Invalid free\\(\\).*: main .*\r\n$gdb_prompt $" {
pass $test
- break
+ # In Ubuntu 10.04.4 environments 'break' does not work here.
+ set loop 0
}
-re "Remote connection closed.*\r\n$gdb_prompt $" {
fail "$test (remote connection closed)"