Hi,

There is a bug in file h8300-tdep.c function  'examine_prologue',
when is checking for push multiple instructions as follows:


 /* Now check for push multiple insns.  */
       if (insn_word == 0x0110 || insn_word == 0x0120 || insn_word ==
0x0130)
       {
          int count = ((insn_word >> 4) & 0xf) + 1;
          int start, i;

            ip = next_ip;
            next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn_word);
            start = insn_word & 0x7;

            for (i = start; i <= start + count; i++)
            {
                fsr->regs[i] = after_prolog_fp + auto_depth;
                auto_depth += 4;
            }
        }

The 'for' statement should be :

  for (i = start; i < start + count; i++)

This bug will cause frame registers to be wrong and 'backtrace'
and show registers in gdb will be wrong.

I've tested the fix for Hitachi HS2000 series microcontrollers
and it works.
For Hitachi H8300 series it is not a problem as they don't have
multiple pop/push instructions.

Regards,
Magda Raltcheva


--------------------------------------------------------------------
This e-mail message has been scanned and cleared for delivery to its intended 
recipients. Only the intended recipient may access or use it. Any distribution, use, 
dissemination, reproduction, copying of this e-mail without prior written consent is 
prohibited. If you are not the intended recipient, please notify us immediately by 
return e-mail and then delete this e-mail.

Visit our website at http://www.codan.com.au
--------------------------------------------------------------------

_______________________________________________
Bug-gdb mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gdb

Reply via email to