This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Fix gdb.trace/mi-traceframe-changed.exp to check for target trace support
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Date: Thu, 09 Jan 2014 19:21:20 -0200
- Subject: [PATCH] Fix gdb.trace/mi-traceframe-changed.exp to check for target trace support
- Authentication-results: sourceware.org; auth=none
Hi,
This patch is related to one of the "regressions" that I reported on the
GDB 7.7 testing thread. While investigating the issue, I found that
gdb.trace/mi-traceframe-changed.exp was running without actually
checking if the target supported tracing or not. So I wrote this patch
to fix the issue.
It is now reporting the test as unsupported on s390x when run without
gdbserver. When I run it with gdbserver, yet another error happens that
prevents the testcase to test if the target supports tracing, but it is
unrelated to the "regression" and happens with other testcases as well.
OK to apply?
--
Sergio
gdb/testsuite
2014-01-09 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.trace/mi-traceframe-changed.exp: Test if the target supports
tracing before running the test. Use prepare_for_testing instead
of gdb_compile.
diff --git a/gdb/testsuite/gdb.trace/mi-traceframe-changed.exp b/gdb/testsuite/gdb.trace/mi-traceframe-changed.exp
index 4bcf379..b5380c5 100644
--- a/gdb/testsuite/gdb.trace/mi-traceframe-changed.exp
+++ b/gdb/testsuite/gdb.trace/mi-traceframe-changed.exp
@@ -14,8 +14,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
load_lib trace-support.exp
-load_lib mi-support.exp
-set MIFLAGS "-i=mi"
standard_testfile tfile.c
set executable $testfile
@@ -30,15 +28,30 @@ if {![is_remote host] && ![is_remote target]} {
set purely_local 0
}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
- executable \
- [list debug nowarnings \
- "additional_flags=-DTFILE_DIR=\"$tfile_dir\""]] \
- != "" } {
- untested ${testfile}.exp
- return -1
+if { [prepare_for_testing $testfile.exp $testfile $srcfile \
+ [list debug nowarnings additional_flags=-DTFILE_DIR="${tfile_dir}"]] } {
+ untested $testfile.exp
+ return -1
}
+# Testing if the target supports tracing.
+if { ![runto_main] } {
+ fail "Cannot test if target supports tracing"
+ return -1
+}
+
+if { ![gdb_target_supports_trace] } {
+ unsupported "Current target does not support trace"
+ return -1
+}
+
+gdb_exit
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+mi_gdb_start
+
# Make sure we are starting fresh.
remote_file host delete $tfile_basic
remote_file target delete $tfile_basic