summaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2011-02-14 11:21:24 +0000
committerPedro Alves <pedro@codesourcery.com>2011-02-14 11:21:24 +0000
commitd1a11fe646d2bf954560fcc5cc4a99678d984722 (patch)
tree06e95370c3e3ca612ca1d8c98e3f30dfb8210b87 /gdb/exec.c
parentc93c96b8b6fa91a8aeb97e013399d2fdf6183368 (diff)
downloadgdb-d1a11fe646d2bf954560fcc5cc4a99678d984722.tar.gz
Mark pieces of values as unavailable if the corresponding memory
is unavailable. gdb/ * valops.c: Include tracepoint.h. (value_fetch_lazy): Use read_value_memory. (read_value_memory): New. * value.h (read_value_memory): Declare. * dwarf2loc.c (read_pieced_value): Use read_value_memory. * exec.c (section_table_available_memory): New function. * exec.h (section_table_available_memory): Declare.
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 0eea1d70bd3..1cca3b336d0 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -572,6 +572,43 @@ map_vmap (bfd *abfd, bfd *arch)
}
+VEC(mem_range_s) *
+section_table_available_memory (VEC(mem_range_s) *memory,
+ CORE_ADDR memaddr, LONGEST len,
+ struct target_section *sections,
+ struct target_section *sections_end)
+{
+ struct target_section *p;
+ ULONGEST memend = memaddr + len;
+
+ for (p = sections; p < sections_end; p++)
+ {
+ if ((bfd_get_section_flags (p->bfd, p->the_bfd_section)
+ & SEC_READONLY) == 0)
+ continue;
+
+ /* Copy the meta-data, adjusted. */
+ if (mem_ranges_overlap (p->addr, p->endaddr - p->addr, memaddr, len))
+ {
+ ULONGEST lo1, hi1, lo2, hi2;
+ struct mem_range *r;
+
+ lo1 = memaddr;
+ hi1 = memaddr + len;
+
+ lo2 = p->addr;
+ hi2 = p->endaddr;
+
+ r = VEC_safe_push (mem_range_s, memory, NULL);
+
+ r->start = max (lo1, lo2);
+ r->length = min (hi1, hi2) - r->start;
+ }
+ }
+
+ return memory;
+}
+
int
section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf,
ULONGEST offset, LONGEST len,