Register Cache.

Andrew Cagney ac131313@cygnus.com
Mon Mar 26 06:46:00 GMT 2001


Just FYI,

I'm letting this e-mail slip off my desk and onto the floor.  Someone
will eventually re-visit the idea (since it is very real).?

	Andrew


To : gdb at sources dot redhat dot com
Subject : Register Cache.
>From : Steven Johnson <sbjohnson at ozemail dot com dot au>
Date : Wed, 30 Aug 2000 10:47:06 +1000
References : <8AE4B526B977D411841F00A0CC334020052C28@cuz-exchange.sdesigns.net>

GDB caches it's register reads. ie, it will only read a register once, and
will only write a register if it thinks the value has changed.

For Example:

set $myreg=0x12345678     <-- Results in GDB Actually changing the register.
set $myreg=0x12345678     <-- Filtered by GDB and doesnt set register.

Now this seems fine on the surface, but there are many registers that
the act of writing is sometimes more important than the data (like say a
watchdog reset register). You may need to write the same value multiple times.

I Can find no way of forcing GDB to not cache its register accesses (dcache
also has this problem, but it also has a solution) does anyone know of a way to
force GDB to either always update registers and read registers and not cache
them, or of a way to force GDB to set it's status of these registers as unknown
(and hence making it update from the register).

Ive spent all day hunting through the code ("Using the source" as some would
say) but i'm damned if I can find anything. So I am attempting to introduce my
own solution. But obviously I may have missed something. 

Steven Johnson



More information about the Gdb mailing list