[PATCH]: memory region attributes
Michael Snyder
msnyder@cygnus.com
Wed Jan 24 17:25:00 GMT 2001
"J.T. Conklin" wrote:
>
> >>>>> "Michael" == Michael Snyder <msnyder@cygnus.com> writes:
> >> Is there any reason why rw_common() doesn't call target_xfer_memory()?
>
> Michael> Yep. Infinite recursion. Target_xfer_memory calls thread_db
> Michael> functions which call rw_common. I know, it's very tempting.
> Michael> I found this out the hard way. ;-)
>
> >> If I'm reading the code correctly, rw_common replicates a lot of what
> >> is in sol_thread_xfer_memory(). If it called target_xfer_memory() it
> >> would support the dcache and memory attributes without any special
> >> accomidations and without significant overhead.
>
> Michael> See above.
>
> So what breaks the cycle? Both sol_thread_xfer_memory() and basically do:
>
> if (target_has_execution)
> retval = procfs_ops.to_xfer_memory (memaddr, myaddr, len,
> dowrite, attrib, target);
> else
> retval = orig_core_ops.to_xfer_memory (memaddr, myaddr, len,
> dowrite, attrib, target);
>
> So if there is recursion with target_xfer_memory(), I don't understand
> how it is avoided without it. If I get some time tomorrow I'll try to
> see it myself.
Sol_thread_xfer_memory calls target_thread_alive which calls
libthread_db which calls rw_common.
More information about the Gdb-patches
mailing list