Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Tom Tromey <tromey@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [RFC 2/2] Test entry values in trace frame
Date: Wed, 21 Aug 2013 06:06:00 -0000	[thread overview]
Message-ID: <521458A8.7060304@codesourcery.com> (raw)
In-Reply-To: <87siy4gsn4.fsf@fleche.redhat.com>

On 08/21/2013 01:48 AM, Tom Tromey wrote:
> I think on the whole I'd rather we not check in a test that fails.
> 
> I know we already have tests like that, but what I've noticed is that
> these tests only ever seem to be fixed as a side effect of fixing
> something else.  Otherwise the failures are just universally ignored.
> 
> I suppose the best thing to do is to file a bug about this problem.
> Then you can attach this patch to the bug.
> 
> What do you think?

I agree.  I opened PR15871 http://sourceware.org/bugzilla/show_bug.cgi?id=15871

On the other hand, I kfail the test.

-- 
Yao (齐尧)

gdb/testsuite:

2013-08-21  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/entry-values.c (end): New
	(main): Call end.
	* gdb.trace/entry-values.exp: Load trace-support.exp.  Set
	tracepoint and collect data.  Test entry value is unavailable.
---
 gdb/testsuite/gdb.trace/entry-values.c   |    5 +++
 gdb/testsuite/gdb.trace/entry-values.exp |   48 ++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/entry-values.c b/gdb/testsuite/gdb.trace/entry-values.c
index 3f98615..e287203 100644
--- a/gdb/testsuite/gdb.trace/entry-values.c
+++ b/gdb/testsuite/gdb.trace/entry-values.c
@@ -32,6 +32,10 @@ bar (int i)
 int global1 = 1;
 int global2 = 2;
 
+static void
+end (void)
+{}
+
 int
 main (void)
 {
@@ -41,5 +45,6 @@ main (void)
   global2++;
   ret = bar (0);
 
+  end ();
   return ret;
 }
diff --git a/gdb/testsuite/gdb.trace/entry-values.exp b/gdb/testsuite/gdb.trace/entry-values.exp
index 30db4a6..cf2cb6f 100644
--- a/gdb/testsuite/gdb.trace/entry-values.exp
+++ b/gdb/testsuite/gdb.trace/entry-values.exp
@@ -230,3 +230,51 @@ gdb_test_sequence "bt" "bt (2)" {
     "\[\r\n\]#1 .* bar \\(i=<optimized out>, i@entry=<optimized out>\\)"
     "\[\r\n\]#2 .* main \\(\\)"
 }
+
+# Restart GDB and trace.
+
+clean_restart $binfile
+
+load_lib "trace-support.exp"
+
+if ![runto_main] {
+    fail "Can't run to main to check for trace support"
+    return -1
+}
+
+if ![gdb_target_supports_trace] {
+    unsupported "target does not support trace"
+    return -1
+}
+
+gdb_test "trace foo" "Tracepoint $decimal at .*"
+
+if [is_amd64_regs_target] {
+    set spreg "\$rsp"
+} elseif [is_x86_like_target] {
+    set spreg "\$esp"
+} else {
+    set spreg "\$sp"
+}
+
+# Collect arguments i and j.  Collect 'global1' which is entry value
+# of argument i.  Don't collect 'global2' to test the entry value of
+# argument j.
+
+gdb_trace_setactions "set action for tracepoint 1" "" \
+    "collect i, j, global1, \(\*\(void \*\*\) \($spreg\)\) @ 64" "^$"
+
+gdb_test_no_output "tstart"
+
+gdb_breakpoint "end"
+gdb_continue_to_breakpoint "end"
+
+gdb_test_no_output "tstop"
+
+gdb_test "tfind" "Found trace frame 0, .*" "tfind start"
+
+# Since 'global2' is not collected, j@entry is expected to be 'unavailable'.
+setup_kfail "gdb/15871" *-*-*
+gdb_test "bt 1" "#0 .* foo \\(i=\[-\]?$decimal, i@entry=2, j=\[-\]?$decimal, j@entry=<unavailable>\\).*"
+
+gdb_test "tfind" "Target failed to find requested trace frame\..*"
-- 
1.7.7.6


  reply	other threads:[~2013-08-21  6:06 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13  7:41 [PATCH 0/2] Test case on entry values Yao Qi
2013-08-13  7:41 ` [RFC 2/2] Test entry values in trace frame Yao Qi
2013-08-20 17:48   ` Tom Tromey
2013-08-21  6:06     ` Yao Qi [this message]
2013-08-21 14:35       ` [PATCH] PR gdb/15871: Unavailable entry value is not shown correctly Pedro Alves
2013-08-21 14:47         ` Mark Kettenis
2013-08-21 15:32           ` Pedro Alves
2013-08-21 15:43             ` Mark Kettenis
2013-08-22  1:25             ` Yao Qi
2013-08-22 10:04               ` [COMMIT] " Pedro Alves
2013-08-23  1:08                 ` Yao Qi
2013-08-23 16:50                   ` Pedro Alves
2013-08-23  0:32       ` [RFC 2/2] Test entry values in trace frame Yao Qi
2013-08-23 17:04         ` Pedro Alves
2013-08-23 19:16           ` Tom Tromey
2013-08-24  1:56             ` Yao Qi
2013-08-13  7:41 ` [PATCH 1/2] Test case for entry values Yao Qi
2013-08-20 17:39   ` Tom Tromey
2013-08-21  5:55     ` Yao Qi
2013-08-21 15:02       ` Tom Tromey
2013-08-22  0:12         ` Yao Qi
2013-08-22 14:05           ` Tom Tromey
2013-08-23  0:27             ` Yao Qi
2013-08-23 19:23               ` Tom Tromey
2013-08-24  1:56                 ` Yao Qi
2013-08-30 14:52   ` Vidya Praveen
2013-08-30 15:29     ` Vidya Praveen
2013-08-31  0:22       ` Yao Qi
2013-09-10 15:30         ` Vidya Praveen
2013-09-10 23:44           ` Yao Qi
2013-09-11 13:27             ` Vidya Praveen

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=521458A8.7060304@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /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