This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] m32r-*-gdb outputs wrong dissassemble codes for 0x*2 addresses.
- From: Kazuhiro Inaoka <inaoka dot kazuhiro at renesas dot com>
- To: cgen at sources dot redhat dot com
- Cc: binutils at sources dot redhat dot com, gdb-patches at sources dot redhat dot com
- Date: Tue, 10 Feb 2004 16:39:40 +0900
- Subject: [PATCH] m32r-*-gdb outputs wrong dissassemble codes for 0x*2 addresses.
Hello,
This is a patch to fix the following bug.
gdb outputs wrong disassemble codes for 0x*2 addresses.
(gdb) x/i 0x100
0x100 <__init>: push fp -> push lr
(gdb) x/i 0x102
0x102 <__init+2>: -> st r6,@r0 <== NG
Please commit it and regenerate opcodes/m32r-dis.c.
Regards,
Kazuhiro Inaoka
cgen/ChangeLog
2004-02-10 Kazuhiro Inaoka < inaoka dot kazuhiro at renesas dot com >
* cpu/m32r.opc (my_print_insn): Fixed gdb outputs wrong disassemble
codes for 0x*2 addresses.
opcodes/ChangeLog
2004-02-10 Kazuhiro Inaoka < inaoka dot kazuhiro at renesas dot com >
* m32r-dis.c: Regenerate.
Index: m32r.opc
===================================================================
RCS file: /cvs/src/src/cgen/cpu/m32r.opc,v
retrieving revision 1.4
diff -c -r1.4 m32r.opc
*** m32r.opc 3 Dec 2003 17:38:50 -0000 1.4
--- m32r.opc 10 Feb 2004 07:14:02 -0000
***************
*** 273,279 ****
/* Read the base part of the insn. */
! status = (*info->read_memory_func) (pc, buf, buflen, info);
if (status != 0)
{
(*info->memory_error_func) (status, pc, info);
--- 273,280 ----
/* Read the base part of the insn. */
! status = (*info->read_memory_func) (pc - ((!big_p && (pc & 3) != 0) ? 2 : 0),
! buf, buflen, info);
if (status != 0)
{
(*info->memory_error_func) (status, pc, info);
***************
*** 286,298 ****
return print_insn (cd, pc, info, buf, buflen);
/* Print the first insn. */
- buf += (big_p ? 0 : 2);
if ((pc & 3) == 0)
{
if (print_insn (cd, pc, info, buf, 2) == 0)
(*info->fprintf_func) (info->stream, UNKNOWN_INSN_MSG);
}
- buf += (big_p ? 2 : -2);
x = (big_p ? &buf[0] : &buf[1]);
if (*x & 0x80)
--- 287,299 ----
return print_insn (cd, pc, info, buf, buflen);
/* Print the first insn. */
if ((pc & 3) == 0)
{
+ buf += (big_p ? 0 : 2);
if (print_insn (cd, pc, info, buf, 2) == 0)
(*info->fprintf_func) (info->stream, UNKNOWN_INSN_MSG);
+ buf += (big_p ? 2 : -2);
}
x = (big_p ? &buf[0] : &buf[1]);
if (*x & 0x80)