From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: David Taylor , gdb-patches@sources.redhat.com, Michael Snyder Subject: Re: [RFA] regcache.c (register_fetched) + related changes Date: Wed, 28 Feb 2001 18:27:00 -0000 Message-id: <3A9DB30C.62C07D74@cygnus.com> References: <200102282113.QAA18390@texas.cygnus.com> <3A9D8655.C57F3DB6@cygnus.com> X-SW-Source: 2001-02/msg00541.html Andrew Cagney wrote: > Yes. My suggestion, hinted at in the last e-mail, would be to combine > the two disjoint operations: > > supply_register(....); > set_register_cache(..., -1) > > into an atomic cache transaction: > > supply_unavailable_register(....) PS/2: The comment on supply_register() in regcache.c reads: [....] If VAL is a NULL pointer, then it's probably an unsupported register. We just set its value to all zeros. We might want to record this fact, and report it to the users of read_register and friends. */ Nothing is recorded. The register is simply set to zero. Checking the target code, this ``feature'' is used a lot (eg alphabsd-nat.c): if (CANNOT_FETCH_REGISTER (i)) supply_register (i, NULL); else supply_register (i, (char *) &gregsetp->r_regs[i]); GDB really should record this cache state giving: valid unavailable invalid unsupported Alternativly, the states unavailable and unsupported could be merged. remote.c, which puts the cache into ``unavailable'' state, also writes zeros into the register. Thoughts? Especially from the people that added introspect support. Andrew