This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Overlay target stratum?
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb at sources dot redhat dot com
- Date: Fri, 24 Oct 2003 16:43:18 -0400
- Subject: Overlay target stratum?
Hello,
In working through target code, I keep comming across overlay stuff.
I'm wondering if it should be moved to its own overlay-target stratum?
The user could then (at least in theory) view memory according to the
overlay, or according to the underlying physical representation. Also,
totally in theory, a variant of the stratum could be implemented that
modeled an OS's VM system! However, that's a later bridge to cross.
The approach would be:
target has segments (aka section_table)
segment has
base, length
offset
target (or bfd)
A memory read/write would do a virtual/physical translation using the
segment (aka section table) and then call the underlying target's xfer
function.
Actual code would be:
s = this->section_by_addr (addr);
s->target->xfer (addr - s->base + s->offset, len adjusted by s->length
The existing code already does this, but only for bfd backed segments.
(Oh, the existing code also does really evil things with the section
table - independant targets somehow sharing a common table :-()
Thoughts?
thoughts?
Andrew