Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: GDB Patches <gdb-patches@sourceware.org>
Subject: [PATCH] Fix gdb.trace/mi-traceframe-changed.exp to check for target trace support
Date: Thu, 09 Jan 2014 21:21:00 -0000	[thread overview]
Message-ID: <m3mwj4onqn.fsf@redhat.com> (raw)

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


             reply	other threads:[~2014-01-09 21:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-09 21:21 Sergio Durigan Junior [this message]
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

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=m3mwj4onqn.fsf@redhat.com \
    --to=sergiodj@redhat.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