[pushed,2/2,gdb/testsuite] Improve gdb.arch/arm-pthread_cond_timedwait-bt.exp

Message ID 20230722090044.18503-2-tdevries@suse.de
State Committed
Headers
Series [pushed,1/2,gdb/testsuite] Use proc readnow in two test-cases |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm warning Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 warning Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 warning Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_check--master-arm warning Patch failed to apply

Commit Message

Tom de Vries July 22, 2023, 9 a.m. UTC
  I noticed in test-case gdb.arch/arm-pthread_cond_timedwait-bt.exp that
prepare_for_testing is used, followed by a clean_restart.

This calls clean_restart twice in a row.

Fix this by using build_executable instead.

Also, I noticed that the test-case requires an SVC instruction, so add a
require to limit the test-case to supported architectures.

While we're at it, run M-x indent-region in emacs to fix indentation.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp b/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp
index 17f8d68b847..e64fa46ef4f 100644
--- a/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp
+++ b/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp
@@ -17,21 +17,24 @@ 
 # syscall is active. But some active syscalls keep PC pointing to the SVC
 # instruction itself.
 
+# Require an architecture with the SVC instruction.
+require {is_any_target "aarch64*-*-*" "arm*-*-*"}
+
 # See if we have target board readnow.exp or similar.  We're using
 # --readnever, which is not allowed in combination with --readnow.
 require !readnow
 
 standard_testfile
 
-if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
-			  {debug pthreads}] } {
+if { [build_executable "failed to prepare" ${testfile} ${srcfile} \
+	  {debug pthreads}] } {
     return
 }
 
 save_vars { GDBFLAGS } {
     append GDBFLAGS " --readnever"
     if { [clean_restart ${binfile}] == -1 } {
-       return -1
+	return -1
     }
 }