This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH]: memory region attributes


"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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]