public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] gdb/testsuite/gdb.base/stap-probe: Minor clean-up
Date: Fri, 10 Jan 2020 20:29:00 -0000	[thread overview]
Message-ID: <47e9d49d2d795224f4b3f04c89c268627b850be4@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 47e9d49d2d795224f4b3f04c89c268627b850be4 ***

commit 47e9d49d2d795224f4b3f04c89c268627b850be4
Author:     George Barrett <bob@bob131.so>
AuthorDate: Sat Jan 11 06:30:01 2020 +1100
Commit:     Simon Marchi <simon.marchi@efficios.com>
CommitDate: Fri Jan 10 14:57:35 2020 -0500

    gdb/testsuite/gdb.base/stap-probe: Minor clean-up
    
    This patch resolves a couple of issues with the test case for SystemTap
    user-space probe points:
      1. The preprocessor macro guarding the semaphore variables in the C
         file is (rather confusingly) named USE_PROBES. This has been
         renamed to USE_SEMAPHORES, to better reflect its function.
      2. The test procedures in the expect file improperly pass the flag
         defining USE_PROBES to prepare_for_testing; as such, the test
         binary that's supposed to have probes with semaphores is the same
         as the one without. This has also been fixed.
      3. No test is performed to check that `info probes' returns
         information about probe semaphores. Such a test is included in this
         patch.
    
    gdb/testsuite/ChangeLog
    2020-01-10  George Barrett  <bob@bob131.so>
    
            * gdb.base/stap-probe.c: Rename USE_PROBES to USE_SEMAPHORES.
            * gdb.base/stap-probe.exp: Likewise.
            (stap_test): Pass argument as an additional flag.
            (stap_test_no_debuginfo): Likewise.
            (stap_test): Check `info probes stap' output for semaphore
            addresses if the test binary is supposed to have them.

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 536a964959..84fa9aec6d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2020-01-10  George Barrett  <bob@bob131.so>
+
+	* gdb.base/stap-probe.c: Rename USE_PROBES to USE_SEMAPHORES.
+	* gdb.base/stap-probe.exp: Likewise.
+	(stap_test): Pass argument as an additional flag.
+	(stap_test_no_debuginfo): Likewise.
+	(stap_test): Check `info probes stap' output for semaphore
+	addresses if the test binary is supposed to have them.
+
 2020-01-09  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* gdb.tui/basic.exp: Add more scrolling tests.
diff --git a/gdb/testsuite/gdb.base/stap-probe.c b/gdb/testsuite/gdb.base/stap-probe.c
index f79e9e1cb3..3d742d1253 100644
--- a/gdb/testsuite/gdb.base/stap-probe.c
+++ b/gdb/testsuite/gdb.base/stap-probe.c
@@ -15,7 +15,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#if USE_PROBES
+#if USE_SEMAPHORES
 
 #define _SDT_HAS_SEMAPHORES
 __extension__ unsigned short test_user_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
diff --git a/gdb/testsuite/gdb.base/stap-probe.exp b/gdb/testsuite/gdb.base/stap-probe.exp
index b35f350e44..fce5286451 100644
--- a/gdb/testsuite/gdb.base/stap-probe.exp
+++ b/gdb/testsuite/gdb.base/stap-probe.exp
@@ -22,7 +22,7 @@ proc stap_test {exec_name {arg ""}} {
     global testfile hex srcfile
 
     if {[prepare_for_testing "failed to prepare" ${exec_name} $srcfile \
-	   [concat $arg debug]]} {
+	   [concat additional_flags=$arg debug]]} {
 	return -1
     }
 
@@ -33,9 +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 .*"
-    
+    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,7 +101,7 @@ proc stap_test_no_debuginfo {exec_name {arg ""}} {
     global testfile hex
 
     if {[prepare_for_testing "failed to prepare" ${exec_name} ${testfile}.c \
-	   {$arg nodebug optimize=-O2}]} {
+	   [concat additional_flags=$arg nodebug optimize=-O2]]} {
 	return -1
     }
 
@@ -166,7 +171,7 @@ with_test_prefix "without semaphore, not optimized" {
 }
 
 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" {
@@ -174,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"
 }


             reply	other threads:[~2020-01-10 20:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10 20:29 gdb-buildbot [this message]
2020-01-10 20:29 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master gdb-buildbot
2020-01-10 20:44 ` Failures on Ubuntu-Aarch64-m64, " gdb-buildbot
2020-01-10 20:59 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot
2020-01-11  7:17 ` Failures on Fedora-i686, " gdb-buildbot
2020-01-11  7:26 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2020-01-11  8:03 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-01-11  8:13 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-01-11  8:51 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-01-11  9:42 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47e9d49d2d795224f4b3f04c89c268627b850be4@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).