Re: RFA: assert that target_fetch_registers did its job

Jim Blandy
2004-08-04T17:51:50Z

I've committed the following:

2004-07-21 Jim Blandy <jimb@redhat.com>

* regcache.c (regcache_raw_read): Assert that, after calling
target_fetch_registers, the register we're reading is cached.

Index: gdb/regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.121
diff -c -p -r1.121 regcache.c
*** gdb/regcache.c 2 Aug 2004 21:58:44 -0000 1.121
--- gdb/regcache.c 2 Aug 2004 23:18:56 -0000
*************** regcache_raw_read (struct regcache *regc
*** 614,619 ****
--- 614,620 ----
}
if (!register_cached (regnum))
target_fetch_registers (regnum);
+ gdb_assert (register_cached (regnum));
}
/* Copy the value directly into the register cache. */
memcpy (buf, register_buffer (regcache, regnum),