public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix gdb.trace/mi-traceframe-changed.exp to check for target trace support
@ 2014-01-09 21:21 Sergio Durigan Junior
  2014-01-10  1:23 ` Yao Qi
  0 siblings, 1 reply; 11+ messages in thread
From: Sergio Durigan Junior @ 2014-01-09 21:21 UTC (permalink / raw)
  To: GDB Patches

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-01-16 18:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-09 21:21 [PATCH] Fix gdb.trace/mi-traceframe-changed.exp to check for target trace support Sergio Durigan Junior
2014-01-10  1:23 ` Yao Qi
2014-01-10  2:17   ` Yao Qi
2014-01-10  3:58     ` Sergio Durigan Junior
2014-01-10 10:57       ` Pedro Alves
2014-01-10 17:31         ` Sergio Durigan Junior
2014-01-10 18:57           ` Pedro Alves
2014-01-10 20:41             ` Sergio Durigan Junior
2014-01-13 17:12               ` Pedro Alves
2014-01-15 20:37                 ` Sergio Durigan Junior
2014-01-16 18:20                   ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).