- insn = EXTRACT_INSN (&prologue[vpc]);
- if ((insn & 0xff00) == 0x0100) /* movw rXX, rYY */
- continue;
- else if ((insn & 0xfc00) == 0x2c00) /* mov rXX, rYY */
- continue;
- else
- break;
+ case AVR_PSEUDO_PC_REGNUM:
+ status = regcache_raw_read_unsigned (regcache, AVR_PC_REGNUM, &val);
+ if (status != REG_VALID)
+ return status;
+ val >>= 1;
+ store_unsigned_integer (buf, 4, gdbarch_byte_order (gdbarch), val);
+ return status;
+ default:
+ internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ }
+}
+
+static void
+avr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
+ int regnum, const gdb_byte *buf)
+{
+ ULONGEST val;
+
+ switch (regnum)
+ {
+ case AVR_PSEUDO_PC_REGNUM:
+ val = extract_unsigned_integer (buf, 4, gdbarch_byte_order (gdbarch));
+ val <<= 1;
+ regcache_raw_write_unsigned (regcache, AVR_PC_REGNUM, val);
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, _("invalid regnum"));