[PATCH] Fix gdb.trace/mi-traceframe-changed.exp to check for target trace support

Sergio Durigan Junior sergiodj@redhat.com
Fri Jan 10 03:58:00 GMT 2014


On Friday, January 10 2014, Yao Qi wrote:

> Ah, I read the patch and mi-traceframe-change.exp again, and find my
> last comment is wrong.  Sorry for the confusion.

Thank you!  I was secretly wondering whether my patch was correct or
not, because I thought the testcase was intended to be run partially on
native debugging, as you explained.  I was going to e-mail something
about it tomorrow, but you were faster :-).

> The first half of mi-traceframe-changed.exp (test_tfind_tfile) is to
> test "=traceframe-changed" on tfile target, which is produced by
> tfile.c.  It is expected to run on native debugging.  The second half
> of mi-traceframe-changed.exp (test_tfile_remote) is to test
> "=traceframe-changed" on remote target with a gdbserver connected.  We
> can see mi-traceframe-changed.exp has already have the code to check
> target supports tracing or not.
>
> The root cause is that tfile.c isn't portable and unable to produce
> trace file properly for s390x.  Search FIXME in it.

Indeed, thanks for pointing that.

> We should skip test_find_tfile for targets other than x86-linux or
> x86_64-linux.  Alternatively, we can modify tfile.c for s390x, but I
> think "generating tfile on a unsupported-tracing target" isn't useful.

OK, WDYT of this version then?

-- 
Sergio

2014-01-10  Sergio Durigan Junior  <sergiodj@redhat.com>

	* gdb.trace/mi-traceframe-changed.exp: Only run test_find_tfile
	if the target is x86_64 or i*86 running the Linux kernel.

diff --git a/gdb/testsuite/gdb.trace/mi-traceframe-changed.exp b/gdb/testsuite/gdb.trace/mi-traceframe-changed.exp
index 4bcf379..f2f5224 100644
--- a/gdb/testsuite/gdb.trace/mi-traceframe-changed.exp
+++ b/gdb/testsuite/gdb.trace/mi-traceframe-changed.exp
@@ -88,7 +88,11 @@ proc test_tfind_tfile { } {
     }
 }
 
-test_tfind_tfile
+if { [istarget "x86_64-*-linux*"] || [istarget "i*86-*-linux*"] } {
+    # This test only works on x86_64 and i*86 targets running the Linux
+    # kernel.  See the FIXME's on gdb.trace/tfile.c for more details.
+    test_tfind_tfile
+}
 
 # Change to a different test case in order to run it on target, and get
 # several traceframes.



More information about the Gdb-patches mailing list