From 5a2eb0ef7f9b879c2bbe7b18183353e1d59c93c7 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Tue, 5 Nov 2013 09:50:21 +0800 Subject: Adjust read_value_memory to use to_xfer_partial As the new to_xfer_partial implementations are done in ctf and tfile targets, read_value_memory can be simplified a lot. Call target_xfer_partial in a loop, check return value, and set bytes unavailable when necessary. gdb: 2014-02-23 Yao Qi * valops.c (read_value_memory): Rewrite it. Call target_xfer_partial in a loop. * exec.h (section_table_available_memory): Remove declaration. Move comments to ... * exec.c (section_table_available_memory): ... here. Make it static. --- gdb/exec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gdb/exec.c') diff --git a/gdb/exec.c b/gdb/exec.c index 607f5acc140..758e382702f 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -577,7 +577,12 @@ exec_read_partial_read_only (gdb_byte *readbuf, ULONGEST offset, return TARGET_XFER_E_IO; } -VEC(mem_range_s) * +/* 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 + VEC. */ + +static VEC(mem_range_s) * section_table_available_memory (VEC(mem_range_s) *memory, CORE_ADDR memaddr, ULONGEST len, struct target_section *sections, -- cgit v1.2.1