regcache = (struct regcache *) inferior_regcache_data (thread);
+ if (regcache == NULL)
+ return;
+
if (regcache->registers_valid)
{
struct thread_info *saved_inferior = current_inferior;
{
int offset, i;
+ /* Before changing the register cache internal layout, flush the
+ contents of valid caches back to the threads. */
+ regcache_invalidate ();
+
reg_defs = regs;
num_registers = n;