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]: New maintainer command "flushregs"


Steve,

I have the same problem.  I have a target hardware reset that is sent via "qRcmd".
However, I thought of implementing this as a "hreset" command that would sent the 
reset request and invalidate the register cache.

There are other things being done to allow us to handle registers that should
never be cached (or any weirdness related to registers).

Fernando


Steven Johnson wrote:
> 
> Michael Snyder wrote:
> >
> > I added this to help with testing register fetch and store.
> >
> > 2000-09-01  Michael Snyder  <msnyder@cleaver.cygnus.com>
> >
> >         * regcache.c (reg_flush_command): New function.  Maintainer-mode
> >         command, flushes GDB's register cache, for testing purposes.
> >
> [SNIP PATCH]
> 
> This is needed for more than testing purposes. When doing embedded
> debugging, there are times when the registers of the target can change
> but GDB doesn't know it. At those times GDB needs to be "Forced" to
> flush it's caching. This command is good. Should it be maintenance or
> under some other category?
> 
> To Illistrate when GDB can get out of sync with a Target:
> 
> GDB Has no <standard> command to force a target to reset. (As in
> Hardware Reset).
> 
> I Implemented this in the stub and use a Stub Command from GDB to
> perform it.
> 
> The problem is, after a hardware Reset, all the registers have changed
> but GDB does not know it. GDB Never looses connection to the target
> because I am using a BDM Interface. So If I then try and re-set the
> watchdog and debug registers using GDB, GDB thinks they have already
> been set and refuses to change them.
> 
> I Would imagine there are other scenarios people would get using
> different embedded systems.
> 
> I was actually working on this as well, but I want to add an extra
> function to allow the cache style of registers to be set. ie, "No
> Cache", "Read Cached but never write cached", "Write Cached but never
> Read Cached" and "Full Caching".
> 
> I was thinking about using a set command to do this, like:
> 
> set regcache $regname NOCACHE
> set regcache $regname READCACHE
> set regcache $regname FULLCACHE
> set regcache $regname WRITECACHE
> set regcacge all NOCACHE
> 
> The last one would allow you to set the cache style for all registers at
> once.
> 
> I was also thinking that if this was a command then it would be
> desirable to have:
> 
> info regcache
> 
> which would print all the current cache settings.
> 
> maybe the cache flush would be better (in the fullness of time when all
> things come to pass) as a:
> 
> set regcache $regname FLUSH
> set regcache all FLUSH
> 
> to keep all this stuff contained together.
> 
> What do you think?
> 
> I was just about to do some work in this area and I don't want to step
> on anyones toes if they are also working in this direction.
> 
> Also, do you know how one goes about turning $regname into a register
> number? I haven't found this yet?
> 
> Steven Johnson.

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@cygnus.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299

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