This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug found in gdb-4.16 for target h8300.


Hello,

Could you please see if this problem occures in a more current gdb (see 
http://sources.redhat.com/gdb/current).  If it does the can I suggest 
fileing a bug report (http://sources.redhat.com/gdb/bugs).

Andrew

> 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
> 
> 
> 




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]