From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 50D0C3858D20; Fri, 27 Jan 2023 01:29:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 50D0C3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674782996; bh=8LgzxV4tfcasOBBPIhmxd5qdN+yrxhGKCXKn+XkoyNg=; h=From:To:Subject:Date:From; b=B7/jcovCHG8Q2HLqwqgWaPdJ6+9c9IdnFRVLw8IMB1XxeuFrAD9l70SMJSsS05Ydf J16qgQaZ8aPXSxwCySQgASUIT+BwbKUiS74Hj5w/WPQOYZVE2hSLqIhF5KVW6AYLdD jIyaCTT5qbcNydcyM9TEu0WjSpXP14ypsU51qiLI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Use clean_restart in gdb.threads X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 3ae2b57582b29fce26b00d38363533e761f946a5 X-Git-Newrev: a30f2b7b7e689b3f1bd93c29a1e00c8d852145d3 Message-Id: <20230127012956.50D0C3858D20@sourceware.org> Date: Fri, 27 Jan 2023 01:29:56 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da30f2b7b7e68= 9b3f1bd93c29a1e00c8d852145d3 commit a30f2b7b7e689b3f1bd93c29a1e00c8d852145d3 Author: Tom Tromey Date: Wed Jan 25 10:36:09 2023 -0700 Use clean_restart in gdb.threads =20 Change gdb.threads to use clean_restart more consistently. Diff: --- gdb/testsuite/gdb.threads/attach-stopped.exp | 9 +-------- gdb/testsuite/gdb.threads/fork-thread-pending.exp | 6 +----- gdb/testsuite/gdb.threads/schedlock.exp | 6 +----- gdb/testsuite/gdb.threads/watchthreads.exp | 6 +----- 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/g= db.threads/attach-stopped.exp index a3080c054af..acdfcb5d8c5 100644 --- a/gdb/testsuite/gdb.threads/attach-stopped.exp +++ b/gdb/testsuite/gdb.threads/attach-stopped.exp @@ -32,11 +32,8 @@ remote_exec build "rm -f ${binfile}" #log_user 1 =20 proc corefunc { threadtype } { - global srcfile global binfile global escapedbinfile - global srcdir - global subdir global gdb_prompt =20 set test_spawn_id [spawn_wait_for_attach $binfile] @@ -45,11 +42,7 @@ proc corefunc { threadtype } { # Stop the program=20 remote_exec build "kill -s STOP ${testpid}" =20 - # Start with clean gdb - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${binfile} + clean_restart $binfile =20 # Verify that we can attach to the stopped process. =20 diff --git a/gdb/testsuite/gdb.threads/fork-thread-pending.exp b/gdb/testsu= ite/gdb.threads/fork-thread-pending.exp index db72fb2679b..3ab2d31402c 100644 --- a/gdb/testsuite/gdb.threads/fork-thread-pending.exp +++ b/gdb/testsuite/gdb.threads/fork-thread-pending.exp @@ -79,11 +79,7 @@ gdb_test_multiple "info threads" "$test" { =20 # Start over, but this time, don't switch away from the fork event thread. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir - -gdb_load ${binfile} +clean_restart $binfile if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.threads/schedlock.exp b/gdb/testsuite/gdb.th= reads/schedlock.exp index fa095508fb9..08435015f14 100644 --- a/gdb/testsuite/gdb.threads/schedlock.exp +++ b/gdb/testsuite/gdb.threads/schedlock.exp @@ -146,11 +146,7 @@ proc step_ten_loops { cmd } { } } =20 -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 # We'll need this when we send_gdb a ^C to GDB. Need to do it before we # run the program and gdb starts saving and restoring tty states. diff --git a/gdb/testsuite/gdb.threads/watchthreads.exp b/gdb/testsuite/gdb= .threads/watchthreads.exp index 1aa7957c867..e80c60b8167 100644 --- a/gdb/testsuite/gdb.threads/watchthreads.exp +++ b/gdb/testsuite/gdb.threads/watchthreads.exp @@ -31,11 +31,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile= }" "${binfile}" executab return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - +clean_restart $binfile gdb_test_no_output "set can-use-hw-watchpoints 1" "" =20 #