Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Antoine Tremblay <antoine.tremblay@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Antoine Tremblay <antoine.tremblay@ericsson.com>
Subject: [PATCH 4/5 v2] Add variable length tests for emit_ref in trace-condition.exp
Date: Fri, 27 May 2016 19:05:00 -0000	[thread overview]
Message-ID: <1464375916-16369-4-git-send-email-antoine.tremblay@ericsson.com> (raw)
In-Reply-To: <1464375916-16369-1-git-send-email-antoine.tremblay@ericsson.com>

This patch add variable length tests for emit_ref by reading the variable
passed as argument of 8 to 64 bit.

gdb/testsuite/ChangeLog:

	* gdb.trace/trace-condition.c (marker): Adapt signature to 8 to 64
	bits types.
	(main): Adapt to 8 to 64 bits types.
	* gdb.trace/trace-condition.exp: Add new tests.
---
 gdb/testsuite/gdb.trace/trace-condition.c   | 8 +++++---
 gdb/testsuite/gdb.trace/trace-condition.exp | 7 +++++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/trace-condition.c b/gdb/testsuite/gdb.trace/trace-condition.c
index 94bb30c..f0b1863 100644
--- a/gdb/testsuite/gdb.trace/trace-condition.c
+++ b/gdb/testsuite/gdb.trace/trace-condition.c
@@ -16,8 +16,9 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "trace-common.h"
+#include <inttypes.h>
 
-int globvar;
+int64_t globvar;
 
 static void
 begin (void)
@@ -25,7 +26,7 @@ begin (void)
 }
 
 static void
-marker (int anarg)
+marker (int8_t arg8, int16_t arg16, int32_t arg32, int64_t arg64)
 {
   FAST_TRACEPOINT_LABEL(set_point);
 }
@@ -41,7 +42,8 @@ main ()
   begin ();
 
   for (globvar = 1; globvar < 11; ++globvar)
-    marker (globvar * 100);
+    marker (globvar, globvar + (1 << 8), globvar + (1 << 16),
+	    globvar + (1LL << 32));
 
   end ();
   return 0;
diff --git a/gdb/testsuite/gdb.trace/trace-condition.exp b/gdb/testsuite/gdb.trace/trace-condition.exp
index e179828..b7551b1 100644
--- a/gdb/testsuite/gdb.trace/trace-condition.exp
+++ b/gdb/testsuite/gdb.trace/trace-condition.exp
@@ -132,9 +132,12 @@ foreach trace_command { "trace" "ftrace" } {
     test_tracepoints $trace_command "\$$pcreg == *set_point" 10
 
     # Can we read local variables?
-    test_tracepoints $trace_command "anarg == 100 || anarg == 200" 2 18955_x86_64_failure
+    test_tracepoints $trace_command "arg8 == 1 || arg8 == 2" 2 18955_x86_64_failure
+    test_tracepoints $trace_command "arg16 == 257 || arg16 == 258" 2 18955_x86_64_failure
+    test_tracepoints $trace_command "arg32 == 65537 || arg32 == 65538" 2 18955_x86_64_failure
+    test_tracepoints $trace_command "arg64 == 4294967297 || arg64 == 4294967298" 2 18955_x86_64_failure
     # Can we read global variables?
-    test_tracepoints $trace_command "anarg == 100 && globvar == 1" 1 18955_x86_64_failure
+    test_tracepoints $trace_command "arg16 == 257 && globvar == 1" 1 18955_x86_64_failure
 
     # Test various operations to cover as many opcodes as possible.
     test_tracepoints $trace_command "21 == 21" 10
-- 
2.8.1


  parent reply	other threads:[~2016-05-27 19:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27 19:05 [PATCH 1/5] Add counter-cases for trace-condition.exp tests Antoine Tremblay
2016-05-27 19:05 ` [PATCH 3/5 v2] Add emit_less_unsigned test in trace-condition.exp Antoine Tremblay
2016-05-30 11:02   ` Pedro Alves
2016-05-27 19:05 ` Antoine Tremblay [this message]
2016-05-30 11:02   ` [PATCH 4/5 v2] Add variable length tests for emit_ref " Pedro Alves
2016-05-27 19:05 ` [PATCH 2/5 v2] Move trace conditions tests from ftrace.exp to trace-condition.exp Antoine Tremblay
2016-05-30 11:02   ` Pedro Alves
2016-05-27 19:05 ` [PATCH 5/5 v2] Add tests for 64bit values in trace-condition.exp Antoine Tremblay
2016-05-30 11:02   ` Pedro Alves
2016-05-30 14:50     ` [PATCH 5/5 v3] " Antoine Tremblay
2016-05-30 15:06       ` Pedro Alves
2016-05-30 16:55         ` Antoine Tremblay
2016-05-30 10:50 ` [PATCH 1/5] Add counter-cases for trace-condition.exp tests Pedro Alves
2016-05-30 14:20   ` Antoine Tremblay
2016-05-30 14:48   ` [PATCH 1/5 v3] " Antoine Tremblay
2016-05-30 15:06     ` Pedro Alves

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=1464375916-16369-4-git-send-email-antoine.tremblay@ericsson.com \
    --to=antoine.tremblay@ericsson.com \
    --cc=gdb-patches@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