diff options
author | Pedro Alves <palves@redhat.com> | 2011-02-14 11:21:25 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2011-02-14 11:21:25 +0000 |
commit | e6ca34fcfbd6f341cb70c680d45f229cb5801eeb (patch) | |
tree | 93e23d44a35a3d9a0107b9cb0732e44608858668 /gdb/exec.c | |
parent | 2a7498d819aef97a9abf94dc20899affe68080fe (diff) | |
download | gdb-e6ca34fcfbd6f341cb70c680d45f229cb5801eeb.zip gdb-e6ca34fcfbd6f341cb70c680d45f229cb5801eeb.tar.gz gdb-e6ca34fcfbd6f341cb70c680d45f229cb5801eeb.tar.bz2 |
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.c | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -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, |