This is the mail archive of the gdb-prs@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]

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:


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