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.
This commit is contained in:
parent
2a7498d819
commit
e6ca34fcfb
6 changed files with 163 additions and 11 deletions
37
gdb/exec.c
37
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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue