- /* Clear the target then copy thread's float state there.
- Make a copy of the status word, for some reason?
- */
- memset (fstate, 0, sizeof (struct fpstate));
+ if (!was_aborted && was_valid)
+ /* See which registers have changed after aborting the thread. */
+ {
+ int check_regno;
+
+ for (check_regno = 0; check_regno < I386_NUM_GREGS; check_regno++)
+ if ((thread->fetched_regs & (1 << check_regno))
+ && memcpy (REG_ADDR (&old_state, check_regno),
+ REG_ADDR (state, check_regno),
+ register_size (gdbarch, check_regno)))
+ /* Register CHECK_REGNO has changed! Ack! */
+ {
+ warning (_("Register %s changed after the thread was aborted"),
+ gdbarch_register_name (gdbarch, check_regno));
+ if (regno >= 0 && regno != check_regno)
+ /* Update GDB's copy of the register. */
+ regcache_raw_supply (regcache, check_regno,
+ REG_ADDR (state, check_regno));
+ else
+ warning (_("... also writing this register! Suspicious..."));
+ }
+ }