Share code on to_xfer_partial for tfile and ctf target
In the to_xfer_partial implementations of ctf and tfile, the code on
reading from read-only sections is duplicated. This patch moves it to
a separate function exec_read_partial_read_only.
gdb:
2014-02-23 Yao Qi <yao@codesourcery.com>
* ctf.c (ctf_xfer_partial): Move code to ...
* exec.c (exec_read_partial_read_only): ... it. New function.
* tracefile-tfile.c (tfile_xfer_partial): Likewise.
* tracefile.c: Include "exec.h".
* exec.h (exec_read_partial_read_only): Declare.