This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [RFC] Replace regcache readonly flag with detached flag


On Thu, 13 Jul 2017, Yao Qi wrote:

> > Therefore I'd like to propose removing m_readonly_p and replacing it with:
> >
> >   /* Is this a detached cache?  A detached cache is not attached to a target.
> >      It is used for saving the target's register state (e.g, across an inferior
> >      function call or just before forcing a function return). A detached cache
> >      can be written to and read from, however the values will not be passed
> >      through to a target.
> >      Using the copy constructor or regcache_dup on a regcache will always
> >      create a detached regcache.  */
> >   bool m_detached_p;
> >
> > In most cases this is a 1:1 substitution of m_readonly_p for m_detached_p,
> > except it for the write functions, where we now allow writing to the
> > regcache buffers.
> 
> I am not sure this replacement is reasonable.  The regcache can be
> detached from target, and read-only or read-write.  The regcache can be
> attached to target, and read-write.  I can't think of a case that
> regcache is attached to target and read-only.

 As a matter of interest: what if the target is `core'?

  Maciej


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