+2004-11-10 msnyder <msnyder@redhat.com>
+
+ * rs6000-tdep.c (skip_prologue): After saving lr_offset,
+ must invalidate lr_reg (so we don't try to save it again).
+ Ditto for cr_offset and cr_reg.
+
2004-11-05 Jon Beniston <jon@beniston.com>
* remote.c (putpkt_binary) Fix PR gdb/1806. Send an ACK
continue;
}
- else if (lr_reg != -1 &&
+ else if (lr_reg >= 0 &&
/* std Rx, NUM(r1) || stdu Rx, NUM(r1) */
(((op & 0xffff0000) == (lr_reg | 0xf8010000)) ||
/* stw Rx, NUM(r1) */
{ /* where Rx == lr */
fdata->lr_offset = offset;
fdata->nosavedpc = 0;
- lr_reg = 0;
+ /* Invalidate lr_reg, but don't set it to -1.
+ That would mean that it had never been set. */
+ lr_reg = -2;
if ((op & 0xfc000003) == 0xf8000000 || /* std */
(op & 0xfc000000) == 0x90000000) /* stw */
{
continue;
}
- else if (cr_reg != -1 &&
+ else if (cr_reg >= 0 &&
/* std Rx, NUM(r1) || stdu Rx, NUM(r1) */
(((op & 0xffff0000) == (cr_reg | 0xf8010000)) ||
/* stw Rx, NUM(r1) */
((op & 0xffff0000) == (cr_reg | 0x94010000))))
{ /* where Rx == cr */
fdata->cr_offset = offset;
- cr_reg = 0;
+ /* Invalidate cr_reg, but don't set it to -1.
+ That would mean that it had never been set. */
+ cr_reg = -2;
if ((op & 0xfc000003) == 0xf8000000 ||
(op & 0xfc000000) == 0x90000000)
{