This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
gdb and binutils branch gdb-7.8-branch updated. d1156d424cda9ee13f0c92dedd81b98e85e4305f
- From: palves at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: 25 Jul 2014 09:43:34 -0000
- Subject: gdb and binutils branch gdb-7.8-branch updated. d1156d424cda9ee13f0c92dedd81b98e85e4305f
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".
The branch, gdb-7.8-branch has been updated
via d1156d424cda9ee13f0c92dedd81b98e85e4305f (commit)
from 197a92ef77001a674af2116d13d4387932ae6480 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d1156d424cda9ee13f0c92dedd81b98e85e4305f
commit d1156d424cda9ee13f0c92dedd81b98e85e4305f
Author: Pedro Alves <palves@redhat.com>
Date: Fri Jul 25 10:21:12 2014 +0100
Fix paginate-*.exp races
Jan pointed out in
<https://sourceware.org/ml/gdb-patches/2014-07/msg00553.html> that
these testcases have racy results:
gdb.base/double-prompt-target-event-error.exp
gdb.base/paginate-after-ctrl-c-running.exp
gdb.base/paginate-bg-execution.exp
gdb.base/paginate-execution-startup.exp
gdb.base/paginate-inferior-exit.exp
This is easily reproducible with "read1" from:
[reproducer for races of expect incomplete reads]
http://sourceware.org/bugzilla/show_bug.cgi?id=12649
The '-notransfer -re "<return>" { exp_continue }' trick in the current
tests doesn't actually work.
The issue that led to the -notransfer trick was that
"---Type <return> to continue, or q <return> to quit---"
has two "<return>"s. If one wants gdb_test_multiple to not hit the
built-in "<return>" match that results in FAIL, one has to expect the
pagination prompt in chunks, first up to the first "<return>", then
again, up to the second. Something around these lines:
gdb_test_multiple "" $test {
-re "<return>" {
exp_continue
}
-re "to quit ---" {
pass $test
}
}
The intent was for -notransfer+exp_continue to make expect fetch more
input, and rerun the matches against the now potentially fuller
buffer, and then eventually the -re that includes the full pagination
prompt regex would match instead (because it's listed higher up, it
would match first). But, once that "<return>" -notransfer -re
matches, it keeps re-matching forever. It seems like with
exp_continue, expect immediately retries matching, instead of first
reading in more data into the buffer, if available.
Fix this like I should have done in the first place. There's actually
no good reason for gdb_test_multiple to only match "<return>". We can
make gdb_test_multiple expect the whole pagination prompt text
instead, which is store in the 'pagination_prompt' global (similar to
'gdb_prompt'). Then a gdb_test_multiple caller that doesn't want the
default match to trigger, because it wants to see one pagination
prompt, does simply:
gdb_test_multiple "" $test {
-re "$pagination_prompt$" {
pass $test
}
}
which is just like when we don't want the default $gdb_prompt match
within gdb_test_multiple to trigger, like:
gdb_test_multiple "" $test {
-re "$gdb_prompt $" {
pass $test
}
}
Tested on x86_64 Fedora 20. In addition, I've let the racy tests run
all in parallel in a loop for 30 minutes, and they never failed.
[gdb 7.8: lib/gdb-utils.exp didn't exist in the branch yet, so this patch adds it.]
gdb/testsuite/
2014-07-25 Pedro Alves <palves@redhat.com>
* gdb.base/double-prompt-target-event-error.exp
(cancel_pagination_in_target_event): Remove '-notransfer <return>'
match.
(cancel_pagination_in_target_event): Rework double prompt
detection.
* gdb.base/paginate-after-ctrl-c-running.exp
(test_ctrlc_while_target_running_paginates): Remove '-notransfer
<return>' match.
* gdb.base/paginate-bg-execution.exp
(test_bg_execution_pagination_return)
(test_bg_execution_pagination_cancel): Remove '-notransfer
<return>' matches.
* gdb.base/paginate-execution-startup.exp
(test_fg_execution_pagination_return)
(test_fg_execution_pagination_cancel): Remove '-notransfer
<return>' matches.
* gdb.base/paginate-inferior-exit.exp
(test_paginate_inferior_exited): Remove '-notransfer <return>'
match.
* lib/gdb-utils.exp: New file.
* lib/gdb.exp: Load gdb-utils.exp.
(pagination_prompt): Run text through string_to_regexp.
(gdb_test_multiple): Match $pagination_prompt instead of
"<return>".
(string_to_regexp): Move to lib/gdb-utils.exp.
-----------------------------------------------------------------------
Summary of changes:
gdb/testsuite/ChangeLog | 28 ++++++++++++++++++++
.../gdb.base/double-prompt-target-event-error.exp | 26 +++++++++++-------
.../gdb.base/paginate-after-ctrl-c-running.exp | 4 ---
gdb/testsuite/gdb.base/paginate-bg-execution.exp | 9 ------
.../gdb.base/paginate-execution-startup.exp | 8 -----
gdb/testsuite/gdb.base/paginate-inferior-exit.exp | 4 ---
.../auto-load-script => lib/gdb-utils.exp} | 12 +++++++-
gdb/testsuite/lib/gdb.exp | 15 +++--------
8 files changed, 58 insertions(+), 48 deletions(-)
copy gdb/testsuite/{gdb.base/auto-load-script => lib/gdb-utils.exp} (70%)
hooks/post-receive
--
gdb and binutils