daily update
Unify ctf_fetch_registers and tfile_fetch_registers

Functions ctf_fetch_registers and tfile_fetch_registers have some
duplicated code about guessing the PC in regcache.  Sometimes, we
may change one function and forget to update the other one, like this
https://www.sourceware.org/ml/gdb-patches/2014-01/msg00292.html

This patch is to move the duplicated code into a new function
tracefile_fetch_registers, and let both ctf_fetch_registers and
tfile_fetch_registers call it.

gdb:

2014-04-22  Yao Qi  <yao@codesourcery.com>

	* tracefile-tfile.c (tfile_fetch_registers): Move the bottom to ...
	* tracefile.c (tracefile_fetch_registers): ... it.  New function.
	* tracefile.h (tracefile_fetch_registers): Declare.
	* ctf.c (ctf_fetch_registers): Remove the bottom.  Call
	tracefile_fetch_registers.
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.