This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
pending/1020: [RFA] sim/h8300/compile.c: Fix the handling of extu.w.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gdb-gnats at sources dot redhat dot com
- Date: Fri, 27 Dec 2002 13:30:30 -0500 (EST)
- Subject: pending/1020: [RFA] sim/h8300/compile.c: Fix the handling of extu.w.
>Number: 1020
>Category: pending
>Synopsis: [RFA] sim/h8300/compile.c: Fix the handling of extu.w.
>Confidential: yes
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: unknown
>Arrival-Date: Sun Feb 02 06:28:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:
>Release:
>Organization:
>Environment:
>Description:
Hi,
Attached is a patch to fix the handling of extu.w.
Giving "extu.w e0" to the H8 simulator causes it to segfault because
the simulation of "extu.w e0" attempts to access a 8-bit wide register
that does not exist. The patch fixes the problem by accessing a
16-bit wide register and then extending its lower half appropriately.
OK to apply?
Kazu Hirata
2002-12-27 Kazu Hirata <kazu@cs.umass.edu>
* compile.c (sim_resume): Fix the handling of exts.w and
extu.w.
Index: compile.c
===================================================================
RCS file: /cvs/src/src/sim/h8300/compile.c,v
retrieving revision 1.18
diff -u -r1.18 compile.c
--- compile.c 26 Dec 2002 05:44:46 -0000 1.18
+++ compile.c 27 Dec 2002 17:44:01 -0000
@@ -1622,7 +1622,7 @@
goto next;
}
case O (O_EXTS, SW):
- rd = GET_B_REG (code->src.reg + 8) & 0xff; /* Yes, src, not dst. */
+ rd = GET_W_REG (code->src.reg) & 0xff; /* Yes, src, not dst. */
ea = rd & 0x80 ? -256 : 0;
res = rd + ea;
goto log16;
@@ -1632,7 +1632,7 @@
res = rd + ea;
goto log32;
case O (O_EXTU, SW):
- rd = GET_B_REG (code->src.reg + 8) & 0xff;
+ rd = GET_W_REG (code->src.reg) & 0xff;
ea = 0;
res = rd + ea;
goto log16;
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: