diff mbox

[testsuite] Invoke gdb with -batch to avoid prompts

Message ID yddy4a2qnz3.fsf@lokon.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth March 1, 2016, 2:20 p.m. UTC
When switching from gdb 7.10 to the newly released gdb 7.11 on Solaris,
all simulate-thread tests started to timeout, adding about 2 1/2 hours
to bootstrap time.  It turned out that this happens as follows: with gdb
7.10, a test is run like this and runs to completion without interaction:

/vol/gcc/bin/amd64/gdb-7.10 -nx -nw -x /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.gdb ./atomic-load-int.exe

With gdb 7.11, OTOH, I see

/vol/gcc/bin/amd64/gdb-7.11 -nx -nw -x /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.gdb ./atomic-load-int.exe 

and the test goes interactive once per page

Thread 2 hit Breakpoint 1, simulate_thread_main ()
    at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int.c:97
97        for (table_cycle_size = 16; table_cycle_size > 4 ; table_cycle_size--)
---Type <return> to continue, or q <return> to quit---

when run interactively, and hangs the test inside the testsuite.

Strangely, this doesn't happen on x86_64-pc-linux-gnu, and I couldn't
find anything related mentioned in the gdb NEWS file.  I didn't dig too
deeply into gdb source code to investigate.

Fortunately, it turns out that the fix is simple: when gdb is invoked
with -batch, both versions behave the same and never go interactive in
this scenario.  The -batch option goes way back (at least to gdb 5.2
which I still had lying around), so this seems a safe change.

Tested with the appropriate runtest invocation on i386-pc-solaris2.12
and x86_64-pc-linux-gnu (with GDB_FOR_GCC_TESTING set to either gdb
version) for gcc.dg/simulate-thread on both and gcc.dg/guality on Linux
only.

Ok for mainline, gcc-5 and gcc-4.9 branches (given that it adds hours to
total bootstrap time)?

	Rainer


2016-02-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* lib/gcc-gdb-test.exp (gdb-test): Make log message match command.
	Invoke gdb with -batch.
	* lib/gcc-simulate-thread.exp (simulate-thread): Likewise.

Comments

Mike Stump March 1, 2016, 5:52 p.m. UTC | #1
On Mar 1, 2016, at 6:20 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
> When switching from gdb 7.10 to the newly released gdb 7.11 on Solaris,
> all simulate-thread tests started to timeout

Ok.  If a domain expert prefers a different strategy, I’m fine with anything better as well.
Rainer Orth March 3, 2016, 10:06 a.m. UTC | #2
Mike Stump <mikestump@comcast.net> writes:

> On Mar 1, 2016, at 6:20 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
>> When switching from gdb 7.10 to the newly released gdb 7.11 on Solaris,
>> all simulate-thread tests started to timeout
>
> Ok.  If a domain expert prefers a different strategy, I’m fine with
> anything better as well.

Given that there were neither objections nor better suggestions, I've
installed the patch everywhere.

Thanks.
        Rainer
diff mbox

Patch

# HG changeset patch
# Parent  b8273f68b9015179dc5b11f384d55efd5b4130a8
Invoke gdb with -batch to avoid prompts

diff --git a/gcc/testsuite/lib/gcc-gdb-test.exp b/gcc/testsuite/lib/gcc-gdb-test.exp
--- a/gcc/testsuite/lib/gcc-gdb-test.exp
+++ b/gcc/testsuite/lib/gcc-gdb-test.exp
@@ -73,8 +73,8 @@  proc gdb-test { args } {
     puts $fd "quit"
     close $fd
 
-    send_log "Spawning: $gdb_name -nx -nw -quiet -x $cmd_file ./$output_file\n"
-    set res [remote_spawn target "$gdb_name -nx -nw -quiet -x $cmd_file ./$output_file"]
+    send_log "Spawning: $gdb_name -nx -nw -quiet -batch -x $cmd_file ./$output_file\n"
+    set res [remote_spawn target "$gdb_name -nx -nw -quiet -batch -x $cmd_file ./$output_file"]
     if { $res < 0 || $res == "" } {
 	unsupported "$testname"
 	file delete $cmd_file
diff --git a/gcc/testsuite/lib/gcc-simulate-thread.exp b/gcc/testsuite/lib/gcc-simulate-thread.exp
--- a/gcc/testsuite/lib/gcc-simulate-thread.exp
+++ b/gcc/testsuite/lib/gcc-simulate-thread.exp
@@ -49,8 +49,8 @@  proc simulate-thread { args } {
 
     set message "thread simulation test"
 
-    send_log "Spawning: $gdb_name -nx -nw -quiet -x $cmd_file ./$exec_file\n"
-    set res [remote_spawn target "$gdb_name -nx -nw  -x $cmd_file ./$exec_file"]
+    send_log "Spawning: $gdb_name -nx -nw -batch -x $cmd_file ./$exec_file\n"
+    set res [remote_spawn target "$gdb_name -nx -nw -batch -x $cmd_file ./$exec_file"]
     if { $res < 0 || $res == "" } {
 	unsupported "$testcase $message"
 	return