#include "target.h"
#include "gdbcmd.h"
#include "language.h"
+#include "filenames.h"
#include "symfile.h"
#include "objfiles.h"
#include "completer.h"
}
\f
+VEC(mem_range_s) *
+section_table_available_memory (VEC(mem_range_s) *memory,
+ CORE_ADDR memaddr, ULONGEST len,
+ struct target_section *sections,
+ struct target_section *sections_end)
+{
+ struct target_section *p;
+
+ 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,
}
}
if (p == t->sections_end)
- warning (_("Cannot find section for the entry point of %s.\n"),
+ warning (_("Cannot find section for the entry point of %s."),
bfd_get_filename (abfd));
entry_point = gdbarch_addr_bits_remove (gdbarch,
table = current_target_sections;
for (p = table->sections; p < table->sections_end; p++)
{
- if (strcmp (filename, p->bfd->filename) == 0
+ if (filename_cmp (filename, p->bfd->filename) == 0
&& index == p->the_bfd_section->index)
{
p->endaddr += address - p->addr;