NetBSD Problem Report #573

From gnats  Sun Nov 13 22:28:12 1994
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id WAA04597 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Sun, 13 Nov 1994 22:28:11 -0800
Message-Id: <9411140629.AA00831@cotton.fs.telcom.oki.co.jp>
Date: Mon, 14 Nov 94 15:29:07 JST
From: oki@fs.telcom.oki.co.jp (Masaru Oki)
Reply-To: oki@fs.telcom.oki.co.jp
To: gnats-bugs@NetBSD.ORG
Subject: invalid displacement is displayed in DDB (x/i)
X-Send-Pr-Version: 3.2

>Number:         573
>Category:       port-m68k
>Synopsis:       invalid displacement is displayed in DDB (x/i)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 13 22:35:05 +0000 1994
>Closed-Date:    Mon Nov 14 21:16:18 +0000 1994
>Last-Modified:  
>Originator:     Masaru Oki
>Release:        1.0
>Organization:
"Oki Electric Industry Co, Ltd., Tokyo, Japan."
>Environment:

System: SunOS cotton 4.1.3-JL 1 sun4m
Architecture: sun4

>Description:
	When trying to disassemble 'short branch' instruction
	(brab, bsrb, ...) on m68k NetBSD (1.0_BETA), invalid
	displacement is displayed.

>How-To-Repeat:
      db> x/i bzero,20
>Fix:
--- src/sys/arch/m68k/m68k/db_disasm.c.orig	Fri Jul  1 19:18:53 1994
+++ src/sys/arch/m68k/m68k/db_disasm.c	Mon Nov 14 09:44:11 1994
@@ -885,7 +885,7 @@
 		sz = SIZE_LONG;
 		addchar('l');
 	} else {
-		disp = *(char *)(dbuf->val + 1);
+		disp = *(((char *)dbuf->val) + 1);
 		/*
 		 * XXX gas chokes on this, I am not sure if
 		 * XXX it can even be made to emit it (short of .word)
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: gwr 
State-Changed-When: Mon Nov 14 13:16:18 PST 1994 
State-Changed-Why:  
Fixed 
>Unformatted:


 Actually, the correct change is:

 < 		disp = *(char *)(dbuf->val + 1);
 < 		/*
 < 		 * XXX gas chokes on this, I am not sure if
 < 		 * XXX it can even be made to emit it (short of .word)
 < 		 */

 > 		/* 8-bit signed displacement in opcode. */
 > 		/* Needs to be sign-extended... */
 > 		if (ISBITSET(disp,7))
 > 			disp -= 256;

 I have commited this and some others. -gwr

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.