aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.h
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2014-02-10 17:17:32 +0800
committerYao Qi <yao@codesourcery.com>2014-02-23 11:44:27 +0800
commit1ca49d376dec6a93e879bc9456617622d7e349b3 (patch)
tree0e2564e9ec48472a73c83abb826f6ec19e7de5f7 /gdb/exec.h
parenta283690eb7320dfe4074301c673f6cc3dd21fb11 (diff)
downloadgdb-1ca49d376dec6a93e879bc9456617622d7e349b3.zip
gdb-1ca49d376dec6a93e879bc9456617622d7e349b3.tar.gz
gdb-1ca49d376dec6a93e879bc9456617622d7e349b3.tar.bz2
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.
Diffstat (limited to 'gdb/exec.h')
-rw-r--r--gdb/exec.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/exec.h b/gdb/exec.h
index 4725f1b..960c585 100644
--- a/gdb/exec.h
+++ b/gdb/exec.h
@@ -46,6 +46,15 @@ extern int build_section_table (struct bfd *, struct target_section **,
extern int resize_section_table (struct target_section_table *, int);
+/* Read from mappable read-only sections of BFD executable files.
+ Return TARGET_XFER_OK, if read is successful. Return
+ TARGET_XFER_EOF if read is done. Return TARGET_XFER_E_IO
+ otherwise. */
+
+extern enum target_xfer_status
+ exec_read_partial_read_only (gdb_byte *readbuf, ULONGEST offset,
+ ULONGEST len, ULONGEST *xfered_len);
+
/* Appends all read-only memory ranges found in the target section
table defined by SECTIONS and SECTIONS_END, starting at (and
intersected with) MEMADDR for LEN bytes. Returns the augmented