Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 2/3] Make test result of gdb.trace/backtrace.exp unique
Date: Thu, 27 Jun 2013 14:02:00 -0000	[thread overview]
Message-ID: <1372341726-5485-3-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1372341726-5485-1-git-send-email-yao@codesourcery.com>

The test result of gdb.trace/backtrace.exp is not unique.

$ cat testsuite/gdb.sum | grep "gdb..*:" | sed 's/[A-Z]\+: //g' | sort | uniq -c | sort -n

 4 gdb.trace/backtrace.exp: 8.6: Backtrace, depth == 1, collect stack mem expr

This patch is fix it.  With this patch applied, the result becomes:

 1 gdb.trace/backtrace.exp: traceframe 14: 8.6: Backtrace, depth == 1, collect stack mem expr
 1 gdb.trace/backtrace.exp: traceframe 19: 8.6: Backtrace, depth == 1, collect stack mem expr
 1 gdb.trace/backtrace.exp: traceframe 4: 8.6: Backtrace, depth == 1, collect stack mem expr
 1 gdb.trace/backtrace.exp: traceframe 9: 8.6: Backtrace, depth == 1, collect stack mem expr

gdb/testsuite:

2013-06-27  Yao Qi  <yao@codesourcery.com>

	PR gdb/13443
	* gdb.trace/backtrace.exp (gdb_backtrace_tdp_3): Add parameter
	'traceframe'.  Wrap test with with_test_prefix.
	(top level): Update.
---
 gdb/testsuite/gdb.trace/backtrace.exp |   42 +++++++++++++++++---------------
 1 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp
index 5349f02..e40428f 100644
--- a/gdb/testsuite/gdb.trace/backtrace.exp
+++ b/gdb/testsuite/gdb.trace/backtrace.exp
@@ -209,24 +209,26 @@ proc gdb_backtrace_tdp_3 { msg } {
     }
 }
 
-proc gdb_backtrace_tdp_4 { msg depth } {
+proc gdb_backtrace_tdp_4 { msg depth traceframe } {
     global gdb_prompt
 
-    # We are in a trace frame at which we collected all registers,
-    # plus a sizeable hunk of stack memory.  This should enable us to
-    # display at least several stack frames worth of backtrace.  We'll
-    # assume that if we can't display at least "depth" levels (with
-    # args), it counts as an error.
-
-    gdb_test_multiple "backtrace" "$msg" {
-	-re "#$depth\[\t \].*gdb_recursion_test.*depth=\[0-9\]+.*q1=\[0-9\]+.*q2=\[0-9\]+.*q3=\[0-9\]+.*q4=\[0-9\]+.*q5=\[0-9\]+.*q6=\[0-9\]+.*$gdb_prompt $" {
-	    pass "$msg"
-	}
-	-re "#$depth\[\t \].*gdb_recursion_test.*depth=.*$gdb_prompt $" {
-	    fail "$msg (args missing from #$depth stack frame)"
-	}
-	-re "#\[0-9\]+\[\t \].*gdb_recursion_test.*depth=.*$gdb_prompt $" {
-	    fail "$msg (fewer than $depth stack frames found)"
+    with_test_prefix "traceframe $traceframe" {
+	# We are in a trace frame at which we collected all registers,
+	# plus a sizeable hunk of stack memory.  This should enable us to
+	# display at least several stack frames worth of backtrace.  We'll
+	# assume that if we can't display at least "depth" levels (with
+	# args), it counts as an error.
+
+	gdb_test_multiple "backtrace" "$msg" {
+	    -re "#$depth\[\t \].*gdb_recursion_test.*depth=\[0-9\]+.*q1=\[0-9\]+.*q2=\[0-9\]+.*q3=\[0-9\]+.*q4=\[0-9\]+.*q5=\[0-9\]+.*q6=\[0-9\]+.*$gdb_prompt $" {
+		pass "$msg"
+	    }
+	    -re "#$depth\[\t \].*gdb_recursion_test.*depth=.*$gdb_prompt $" {
+		fail "$msg (args missing from #$depth stack frame)"
+	    }
+	    -re "#\[0-9\]+\[\t \].*gdb_recursion_test.*depth=.*$gdb_prompt $" {
+		fail "$msg (fewer than $depth stack frames found)"
+	    }
 	}
     }
 }
@@ -258,7 +260,7 @@ gdb_backtrace_tdp_3 "8.6: Backtrace, depth == 1, collect args and locals"
 gdb_tfind_test "8.6: find frame 4"     "4" "4"
 gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
 	"TDP $tdp6:" ""
-gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0"
+gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0" 4
 
 gdb_tfind_test "8.6: find frame 5"     "5" "5"
 gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
@@ -279,7 +281,7 @@ gdb_backtrace_tdp_3 "8.6: Backtrace, depth == 2, collect args and locals"
 gdb_tfind_test "8.6: find frame 9"     "9" "9"
 gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
 	"TDP $tdp6:" ""
-gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0"
+gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0" 9
 
 gdb_tfind_test "8.6: find frame 10"    "10" "10"
 gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
@@ -300,7 +302,7 @@ gdb_backtrace_tdp_3 "8.6: Backtrace, depth == 3, collect args and locals"
 gdb_tfind_test "8.6: find frame 14"    "14" "14"
 gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
 	"TDP $tdp6:" ""
-gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0"
+gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0" 14
 
 gdb_tfind_test "8.6: find frame 15"    "15" "15"
 gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
@@ -321,7 +323,7 @@ gdb_backtrace_tdp_3 "8.6: Backtrace, depth == 4, collect args and locals"
 gdb_tfind_test "8.6: find frame 19"    "19" "19"
 gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
 	"TDP $tdp6:" ""
-gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0"
+gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0" 19
 
 gdb_test "printf \"x \%d x\\n\", depth == 3" \
 	"x 0 x" \
-- 
1.7.7.6


  parent reply	other threads:[~2013-06-27 14:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27 14:02 [PATCH 0/3] Select the current frame in command tdump Yao Qi
2013-06-27 14:02 ` [PATCH 1/3] Tweak gdb.trace/backtrace.exp Yao Qi
2013-07-29 15:44   ` Pedro Alves
2013-06-27 14:02 ` Yao Qi [this message]
2013-07-29 15:44   ` [PATCH 2/3] Make test result of gdb.trace/backtrace.exp unique Pedro Alves
2013-06-27 14:22 ` [PATCH 3/3] Select the current frame in command tdump Yao Qi
2013-07-29 15:44   ` Pedro Alves
2013-07-30 13:23     ` Yao Qi
2013-07-30 13:31       ` Pedro Alves
2013-07-31  0:47         ` Yao Qi
2013-07-22  1:13 ` [PATCH 0/3] " Yao Qi
2013-07-29  9:31   ` [ping 2]: " Yao Qi

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=1372341726-5485-3-git-send-email-yao@codesourcery.com \
    --to=yao@codesourcery.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