From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/2] Check trace data from trace file
Date: Mon, 25 Feb 2013 03:10:00 -0000 [thread overview]
Message-ID: <512AD5CA.50606@codesourcery.com> (raw)
In-Reply-To: <1361761061-9625-1-git-send-email-yao@codesourcery.com>
Here is the same patch with spaces ignored. It is easier to read.
Note that I modified a matched pattern "PC register is not
available" for tfile target, as the regcache is not available when
switch to tfind mode (no regcache has been read out of 'R' block yet).
diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp
index e8aa597..6139485 100644
--- a/gdb/testsuite/gdb.trace/report.exp
+++ b/gdb/testsuite/gdb.trace/report.exp
@@ -181,20 +181,36 @@ gdb_test "continue" \
gdb_test "tstop" ".*" ""
+gdb_tfind_test "9.1: init: make sure not debugging any trace frame" \
+ "none" "-1"
+
+# 9.3 help tdump
+
+gdb_test "help tdump" "Print everything collected at the current.*" \
+ "9.3: help tdump"
+
+# Check the collected trace data from different sources, such as live
+# infeiror and tfile.
+
+proc use_collected_data { data_source } { with_test_prefix "${data_source}" {
+ global tdp1 tdp2 tdp3 tdp4 tdp5 tdp6
+ global testline1 testline2 testline3 testline4 testline5 testline6
+ global pcreg fpreg spreg
+ global srcfile srcdir subdir
+ global arg1 arg3
+ global decimal hex gdb_prompt
#
# 9.1 test the tdump command
#
set timeout 60
-gdb_tfind_test "9.1: init: make sure not debugging any trace frame" "none" "-1"
-
gdb_tfind_test "9.1: find frame for TP $tdp1" "tracepoint $tdp1" \
"\$tracepoint" "$tdp1"
# Nothing was collected at tdp1, so this tdump should be empty.
gdb_test "tdump" \
- "Data collected at tracepoint $tdp1, trace frame $decimal:" \
+ "Data collected at tracepoint $tdp1, trace frame $decimal:\(\|\\r\\nPC register is not available\)" \
"9.1: tdump, nothing collected"
gdb_tfind_test "9.1: find frame for TP $tdp2" "tracepoint $tdp2" \
@@ -243,11 +259,6 @@ gdb_test "tdump" \
# 9.2 test tdump with arguments
# [no go, tdump doesn't have any arguments]
-# 9.3 help tdump
-
-gdb_test "help tdump" "Print everything collected at the current.*" \
- "9.3: help tdump"
-
set linecount1 0
set linecount2 0
set linecount3 0
@@ -385,6 +396,28 @@ gdb_test_multiple "while \$trace_frame != -1\n printf \"TDP #\%d, frame %d: char
}
}
}
+}
+}
+
+use_collected_data "live"
# Finished!
-gdb_tfind_test "finished: make sure not debugging any trace frame" "none" "-1"
+gdb_tfind_test "finished: make sure not debugging any trace frame" \
+ "none" "-1"
+
+# Save trace frames to tfile.
+gdb_test "tsave report.tf" "Trace data saved to file 'report.tf'.*"
+
+# Change target to tfile.
+set test "change to tfile target"
+gdb_test_multiple "target tfile report.tf" "$test" {
+ -re "A program is being debugged already. Kill it. .y or n. " {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "$gdb_prompt $" {
+ pass "$test"
+ }
+}
+# Test the collected trace frames from tfile.
+use_collected_data "tfile"
next prev parent reply other threads:[~2013-02-25 3:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-25 2:58 Yao Qi
2013-02-25 2:58 ` [PATCH 2/2] Find the next matched trace file in 'tfile target' Yao Qi
2013-02-26 19:53 ` Pedro Alves
2013-02-27 1:37 ` Yao Qi
2013-02-25 3:10 ` Yao Qi [this message]
2013-02-26 18:44 ` [PATCH 1/2] Check trace data from trace file Pedro Alves
2013-02-26 18:57 ` Pedro Alves
2013-02-27 1:54 ` Yao Qi
2013-02-27 15:23 ` Pedro Alves
2013-02-28 1:14 ` Yao Qi
2013-02-25 12:03 ` Abid, Hafiz
2013-02-25 14:10 ` Abid, Hafiz
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=512AD5CA.50606@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