diff options
author | 2014-03-21 12:52:24 +0800 | |
---|---|---|
committer | 2014-04-22 09:57:44 +0800 | |
commit | b4429ea262cfbeb9a6ebd9308654b0883b19d1a5 (patch) | |
tree | 338b1e05c454303dcf3d21e023591905eab0903b /gdb/testsuite/gdb.trace/tfile.exp | |
parent | Unify ctf_fetch_registers and tfile_fetch_registers (diff) | |
download | binutils-gdb-b4429ea262cfbeb9a6ebd9308654b0883b19d1a5.tar.gz binutils-gdb-b4429ea262cfbeb9a6ebd9308654b0883b19d1a5.tar.bz2 binutils-gdb-b4429ea262cfbeb9a6ebd9308654b0883b19d1a5.zip |
Check tracefile is generated by binary execution
In gdb.trace/tfile.exp, we execute binary to generate tracefile,
remote_exec target "$binfile"
however, this fails on bare metal target. This patch is to
handle binary execution failure by running binary in GDB.
The binary will do some io operation to generate tracefile, so
we need a check 'target_info exists gdb,nofileio'.
This patch is to check whether tracefile is generated. tfile.exp can
be skipped if generation is failed, while test_tfind_tfile in
mi-traceframe-changed.exp is skipped if generated failed. The rest of
the mi-traceframe-changed.exp can still be executed, because on some
bare metal targets, the remote stub supports tracepoint but doesn't
support fileio.
gdb/testsuite:
2014-04-22 Yao Qi <yao@codesourcery.com>
* lib/trace-support.exp (generate_tracefile): New procedure.
* gdb.trace/tfile.exp: Skip the test if generate_tracefile
return 0.
* gdb.trace/mi-traceframe-changed.exp: Invoke test_tfind_tfile
if generate_tracefile returns 1.
Diffstat (limited to 'gdb/testsuite/gdb.trace/tfile.exp')
-rw-r--r-- | gdb/testsuite/gdb.trace/tfile.exp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/testsuite/gdb.trace/tfile.exp b/gdb/testsuite/gdb.trace/tfile.exp index c98e64cc7bf..d6a60e5397b 100644 --- a/gdb/testsuite/gdb.trace/tfile.exp +++ b/gdb/testsuite/gdb.trace/tfile.exp @@ -34,8 +34,6 @@ if {![is_remote host] && ![is_remote target]} { set purely_local 0 } -gdb_exit -gdb_start standard_testfile if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable \ @@ -45,7 +43,6 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ untested ${testfile}.exp return -1 } -gdb_reinitialize_dir $srcdir/$subdir # Make sure we are starting fresh. remote_file host delete $tfile_basic @@ -53,14 +50,17 @@ remote_file host delete $tfile_error remote_file target delete $tfile_basic remote_file target delete $tfile_error -remote_exec target "$binfile" +if { ![generate_tracefile $binfile] } { + unsupported "Unable to generate trace file" +} + if {!$purely_local} { # Copy tracefile from target to host through build. remote_download host [remote_upload target tfile-basic.tf] tfile-basic.tf remote_download host [remote_upload target tfile-error.tf] tfile-error.tf } -gdb_load $binfile +clean_restart $binfile # Program has presumably exited, now target a trace file it created. |