gdb/testsuite/gdb.base/stap-probe: Minor clean-up
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / stap-probe.exp
index 7310b25b74adc5af58a9e419a282a1e3715a5aee..fce528645100c137cee7f1df8d67dc5e0e8e9db0 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2015 Free Software Foundation, Inc.
+# Copyright (C) 2012-2020 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -21,8 +21,8 @@ standard_testfile
 proc stap_test {exec_name {arg ""}} {
     global testfile hex srcfile
 
-    if {[prepare_for_testing ${testfile}.exp ${exec_name} $srcfile \
-          [concat $arg debug]]} {
+    if {[prepare_for_testing "failed to prepare" ${exec_name} $srcfile \
+          [concat additional_flags=$arg debug]]} {
        return -1
     }
 
@@ -33,10 +33,14 @@ proc stap_test {exec_name {arg ""}} {
     gdb_test "print \$_probe_argc" "No probe at PC $hex" \
        "check argument not at probe point"
 
-    gdb_test "info probes stap" \
-       "test *user *$hex .*" \
-       "info probes stap"
-    
+    if {[string first "-DUSE_SEMAPHORES" $arg] != -1} {
+       gdb_test "info probes stap" \
+           "test *user *$hex *$hex .*"
+    } else {
+       gdb_test "info probes stap" \
+           "test *user *$hex .*"
+    }
+
     if {[runto "-pstap test:user"]} {
        pass "run to -pstap test:user"
     } else {
@@ -96,8 +100,8 @@ proc stap_test {exec_name {arg ""}} {
 proc stap_test_no_debuginfo {exec_name {arg ""}} {
     global testfile hex
 
-    if {[prepare_for_testing ${testfile}.exp ${exec_name} ${testfile}.c \
-          {$arg nodebug optimize=-O2}]} {
+    if {[prepare_for_testing "failed to prepare" ${exec_name} ${testfile}.c \
+          [concat additional_flags=$arg nodebug optimize=-O2]]} {
        return -1
     }
 
@@ -161,13 +165,13 @@ proc stap_test_no_debuginfo {exec_name {arg ""}} {
 
 with_test_prefix "without semaphore, not optimized" {
     if {[stap_test "stap-probe-nosem-noopt"] == -1} {
-       untested stap-probe.exp
+       untested "stap probe test failed"
          return -1
     }
 }
 
 with_test_prefix "with semaphore, not optimized" {
-    stap_test "stap-probe-sem-noopt" "-DUSE_PROBES"
+    stap_test "stap-probe-sem-noopt" "-DUSE_SEMAPHORES"
 }
 
 with_test_prefix "without semaphore, optimized" {
@@ -175,5 +179,5 @@ with_test_prefix "without semaphore, optimized" {
 }
 
 with_test_prefix "with semaphore, optimized" {
-    stap_test_no_debuginfo "stap-probe-sem-opt" "-DUSE_PROBES"
+    stap_test_no_debuginfo "stap-probe-sem-opt" "-DUSE_SEMAPHORES"
 }
This page took 0.030597 seconds and 4 git commands to generate.